diff options
Diffstat (limited to 'tests/test_main.cpp')
-rw-r--r-- | tests/test_main.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/test_main.cpp b/tests/test_main.cpp index 0d83c3ced3..137882841c 100644 --- a/tests/test_main.cpp +++ b/tests/test_main.cpp @@ -35,6 +35,7 @@ #include "test_astar.h" #include "test_basis.h" #include "test_class_db.h" +#include "test_color.h" #include "test_gdscript.h" #include "test_gui.h" #include "test_math.h" @@ -69,7 +70,8 @@ int test_main(int argc, char *argv[]) { char **args = new char *[valid_arguments.size()]; for (int x = 0; x < valid_arguments.size(); x++) { // Operation to convert Godot string to non wchar string. - const char *str = valid_arguments[x].utf8().ptr(); + CharString cs = valid_arguments[x].utf8(); + const char *str = cs.get_data(); // Allocate the string copy. args[x] = new char[strlen(str) + 1]; // Copy this into memory. @@ -82,6 +84,9 @@ int test_main(int argc, char *argv[]) { test_context.setOption("abort-after", 5); test_context.setOption("no-breaks", true); + for (int x = 0; x < valid_arguments.size(); x++) { + delete[] args[x]; + } delete[] args; return test_context.run(); |