From 5699e0fa0c9617138754e1954c6cf71ad98526d9 Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Mon, 22 Nov 2021 16:22:39 +0100
Subject: [PATCH] visualtest: use SDL_malloc
---
visualtest/src/action_configparser.c | 12 ++++++------
visualtest/src/harness_argparser.c | 4 ++--
visualtest/src/parsehelper.c | 4 ++--
visualtest/src/screenshot.c | 4 ++--
visualtest/src/sut_configparser.c | 2 +-
visualtest/src/variator_common.c | 4 ++--
visualtest/src/windows/windows_process.c | 4 ++--
visualtest/src/windows/windows_screenshot.c | 4 ++--
8 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/visualtest/src/action_configparser.c b/visualtest/src/action_configparser.c
index 6d95b91afb7..fc226bc6d9b 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 aa814a67b69..b7f9d0d9981 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 01e64b04c4c..566ad8a49e0 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 394ae090712..189774fd142 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 b4f8e395105..fa8c2d4bbd7 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 4eea9b41b6c..e8444b31758 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 da7a99c5884..36d02991d37 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 5f26754c03f..e3e8ea46032 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;
}