visualtest: use SDL_malloc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
diff --git a/visualtest/src/action_configparser.c b/visualtest/src/action_configparser.c
index 6d95b91..fc226bc 100644
--- a/visualtest/src/action_configparser.c
+++ b/visualtest/src/action_configparser.c
@@ -54,7 +54,7 @@ SDLVisualTest_EnqueueAction(SDLVisualTest_ActionQueue* queue,
sizeof(SDLVisualTest_ActionNode));
if(!node)
{
- SDLTest_LogError("malloc() failed");
+ SDLTest_LogError("SDL_malloc() failed");
return 0;
}
node->action = action;
@@ -220,10 +220,10 @@ SDLVisualTest_InsertIntoActionQueue(SDLVisualTest_ActionQueue* queue,
return 1;
}
- newnode = (SDLVisualTest_ActionNode*)malloc(sizeof(SDLVisualTest_ActionNode));
+ newnode = (SDLVisualTest_ActionNode*)SDL_malloc(sizeof(SDLVisualTest_ActionNode));
if(!newnode)
{
- SDLTest_LogError("malloc() failed");
+ SDLTest_LogError("SDL_malloc() failed");
return 0;
}
newnode->action = action;
@@ -344,7 +344,7 @@ SDLVisualTest_ParseActionConfig(char* file, SDLVisualTest_ActionQueue* queue)
path = (char*)SDL_malloc(sizeof(char) * (len + 1));
if(!path)
{
- SDLTest_LogError("malloc() failed");
+ SDLTest_LogError("SDL_malloc() failed");
SDLVisualTest_EmptyActionQueue(queue);
SDL_RWclose(rw);
return 0;
@@ -358,7 +358,7 @@ SDLVisualTest_ParseActionConfig(char* file, SDLVisualTest_ActionQueue* queue)
args = (char*)SDL_malloc(sizeof(char) * (len + 1));
if(!args)
{
- SDLTest_LogError("malloc() failed");
+ SDLTest_LogError("SDL_malloc() failed");
SDL_free(path);
SDLVisualTest_EmptyActionQueue(queue);
SDL_RWclose(rw);
@@ -393,4 +393,4 @@ SDLVisualTest_ParseActionConfig(char* file, SDLVisualTest_ActionQueue* queue)
SDL_RWclose(rw);
return 1;
-}
\ No newline at end of file
+}
diff --git a/visualtest/src/harness_argparser.c b/visualtest/src/harness_argparser.c
index aa814a6..b7f9d0d 100644
--- a/visualtest/src/harness_argparser.c
+++ b/visualtest/src/harness_argparser.c
@@ -234,7 +234,7 @@ ParseConfig(char* file, SDLVisualTest_HarnessState* state)
argv = (char**)SDL_malloc((num_params + 1) * sizeof(char*));
if(!argv)
{
- SDLTest_LogError("malloc() failed.");
+ SDLTest_LogError("SDL_malloc() failed.");
SDL_RWclose(rw);
return 0;
}
@@ -355,4 +355,4 @@ SDLVisualTest_FreeHarnessState(SDLVisualTest_HarnessState* state)
SDLVisualTest_EmptyActionQueue(&state->action_queue);
SDLVisualTest_FreeSUTConfig(&state->sut_config);
}
-}
\ No newline at end of file
+}
diff --git a/visualtest/src/parsehelper.c b/visualtest/src/parsehelper.c
index 01e64b0..566ad8a 100644
--- a/visualtest/src/parsehelper.c
+++ b/visualtest/src/parsehelper.c
@@ -96,7 +96,7 @@ TokenizeHelper(char* str, char** tokens, int num_tokens, int max_token_len)
if(!tokens[index])
{
int i;
- SDLTest_LogError("malloc() failed.");
+ SDLTest_LogError("SDL_malloc() failed.");
for(i = 0; i < index; i++)
SDL_free(tokens[i]);
return 0;
@@ -215,7 +215,7 @@ SDLVisualTest_ParseArgsToArgv(char* args)
argv = (char**)SDL_malloc((num_tokens + 2) * sizeof(char*));
if(!argv)
{
- SDLTest_LogError("malloc() failed.");
+ SDLTest_LogError("SDL_malloc() failed.");
return NULL;
}
diff --git a/visualtest/src/screenshot.c b/visualtest/src/screenshot.c
index 394ae09..189774f 100644
--- a/visualtest/src/screenshot.c
+++ b/visualtest/src/screenshot.c
@@ -48,7 +48,7 @@ SDLVisualTest_VerifyScreenshots(char* args, char* test_dir, char* verify_dir)
verify_path = (char*)SDL_malloc(verify_len * sizeof(char));
if(!verify_path)
{
- SDLTest_LogError("malloc() failed");
+ SDLTest_LogError("SDL_malloc() failed");
return_code = -1;
goto verifyscreenshots_cleanup_generic;
}
@@ -78,7 +78,7 @@ SDLVisualTest_VerifyScreenshots(char* args, char* test_dir, char* verify_dir)
test_path = (char*)SDL_malloc(test_len * sizeof(char));
if(!test_path)
{
- SDLTest_LogError("malloc() failed");
+ SDLTest_LogError("SDL_malloc() failed");
return_code = -1;
goto verifyscreenshots_cleanup_verifybmp;
}
diff --git a/visualtest/src/sut_configparser.c b/visualtest/src/sut_configparser.c
index b4f8e39..fa8c2d4 100644
--- a/visualtest/src/sut_configparser.c
+++ b/visualtest/src/sut_configparser.c
@@ -61,7 +61,7 @@ SDLVisualTest_ParseSUTConfig(char* file, SDLVisualTest_SUTConfig* config)
sizeof(SDLVisualTest_SUTOption));
if(!config->options)
{
- SDLTest_LogError("malloc() failed");
+ SDLTest_LogError("SDL_malloc() failed");
SDL_RWclose(rw);
return 0;
}
diff --git a/visualtest/src/variator_common.c b/visualtest/src/variator_common.c
index 4eea9b4..e8444b3 100644
--- a/visualtest/src/variator_common.c
+++ b/visualtest/src/variator_common.c
@@ -189,7 +189,7 @@ SDLVisualTest_InitVariation(SDLVisualTest_Variation* variation,
sizeof(SDLVisualTest_SUTOptionValue));
if(!variation->vars)
{
- SDLTest_LogError("malloc() failed");
+ SDLTest_LogError("SDL_malloc() failed");
return 0;
}
variation->num_vars = config->num_options;
@@ -222,4 +222,4 @@ SDLVisualTest_InitVariation(SDLVisualTest_Variation* variation,
}
}
return 1;
-}
\ No newline at end of file
+}
diff --git a/visualtest/src/windows/windows_process.c b/visualtest/src/windows/windows_process.c
index da7a99c..36d0299 100644
--- a/visualtest/src/windows/windows_process.c
+++ b/visualtest/src/windows/windows_process.c
@@ -61,7 +61,7 @@ SDL_LaunchProcess(char* file, char* args, SDL_ProcessInfo* pinfo)
working_directory = (char*)SDL_malloc(path_length + 1);
if(!working_directory)
{
- SDLTest_LogError("Could not allocate working_directory - malloc() failed.");
+ SDLTest_LogError("Could not allocate working_directory - SDL_malloc() failed.");
return 0;
}
@@ -80,7 +80,7 @@ SDL_LaunchProcess(char* file, char* args, SDL_ProcessInfo* pinfo)
command_line = (char*)SDL_malloc(path_length + args_length + 2);
if(!command_line)
{
- SDLTest_LogError("Could not allocate command_line - malloc() failed.");
+ SDLTest_LogError("Could not allocate command_line - SDL_malloc() failed.");
return 0;
}
SDL_memcpy(command_line, file, path_length);
diff --git a/visualtest/src/windows/windows_screenshot.c b/visualtest/src/windows/windows_screenshot.c
index 5f26754..e3e8ea4 100644
--- a/visualtest/src/windows/windows_screenshot.c
+++ b/visualtest/src/windows/windows_screenshot.c
@@ -241,7 +241,7 @@ ScreenshotWindow(HWND hwnd, char* filename, SDL_bool only_client_area)
goto screenshotwindow_cleanup_capturebitmap;
}
- /* free resources */
+ /* Free resources */
screenshotwindow_cleanup_capturebitmap:
if(!DeleteObject(capturebitmap))
@@ -297,7 +297,7 @@ ScreenshotHwnd(HWND hwnd, LPARAM lparam)
filename = (char*)SDL_malloc(len * sizeof(char));
if(!filename)
{
- SDLTest_LogError("malloc() failed");
+ SDLTest_LogError("SDL_malloc() failed");
return FALSE;
}