Fix warnings

This commit is contained in:
Krzosa Karol
2024-03-16 11:51:13 +01:00
parent 1a1432592a
commit da575e8877
2 changed files with 46 additions and 46 deletions

View File

@@ -4,6 +4,51 @@
#include "test_arena.cpp"
#include "test_lexer.cpp"
// ./a.exe -scratch
// ./a.exe -quick
// ./a.exe -run_tests a.test b.test c.test
// ./a.exe --break_on_error
// ./a.exe -build=release
// ./a.exe --help
//
void TestCmdParser() {
const char *argv[] = {
"exe",
"--build_scratch",
"-tests",
"a",
"b",
"c",
"--things",
"1234",
"asdsa",
"-build",
"release",
};
int argc = MA_Lengthof(argv);
MA_Checkpoint scratch = MA_GetScratch();
bool build_scratch = false;
S8_List test_list = {0};
S8_List test_things = {0};
int build_profile = 0;
const char *build_profiles[] = {"debug", "release"};
int build_profiles_count = MA_Lengthof(build_profiles);
CmdParser p = MakeCmdParser(scratch.arena, argc, (char **)argv, "this is a test");
AddBool(&p, &build_scratch, "build_scratch", "builds a sandbox where I experiment with things");
AddList(&p, &test_list, "tests", "list of specific tests to run");
AddList(&p, &test_things, "things", "list of things");
AddEnum(&p, &build_profile, "build", "choose build profile", build_profiles, build_profiles_count);
bool success = ParseCmd(scratch.arena, &p);
IO_Assertf(success, "failed to parse cmd");
IO_Assert(build_scratch);
IO_Assert(test_list.node_count == 3);
IO_Assert(test_things.node_count == 2);
IO_Assert(build_profile == 1);
MA_ReleaseScratch(scratch);
}
int main() {
TestSimpleInsertAndIntegrity();
TestStrings();
@@ -39,7 +84,7 @@ int main() {
// List iteration using For
{
MA_Scratch scratch;
S8_List list = {};
S8_List list = {};
S8_AddF(scratch, &list, "1");
S8_AddF(scratch, &list, "2");
S8_AddF(scratch, &list, "3");