diff --git a/srcs/opendhcp183/query.cpp b/srcs/opendhcp183/query.cpp index b95c5a3..103cda4 100644 --- a/srcs/opendhcp183/query.cpp +++ b/srcs/opendhcp183/query.cpp @@ -54,9 +54,13 @@ typedef struct { } JSON_POST_CTX; static JSON_POST_CTX g_add_msg[] = { - {R"({"type":"object","required":["rangeSet"]})", "Missing required field [rangeSet]"}, - {R"({"properties":{"rangeSet":{"type":"array","minItems":1}}})", "No content in field [rangeSet]"}, - {R"({"properties":{"rangeSet":{"items":{"type":"object","required":["dhcpRange"]}}}})", "Missing required field [dhcpRange]"}, + {R"({"type":"object","required":["rangeSet"]})", "Missing required field [rangeSet]"}, + {R"({"properties":{"rangeSet":{"type":"array","minItems":1}}})", "No content in array [rangeSet]"}, + {R"({"properties":{"rangeSet":{"items":{"type":"object","required":["dhcpRange"]}}}})", "Missing required field [dhcpRange]"}, + {R"({"properties":{"rangeSet":{"items":{"properties":{"netmask":{"type":"string"}}}}}})", "[netmask] should be a string value"}, + {R"({"properties":{"rangeSet":{"items":{"properties":{"domainServer":{"type":"string"}}}}}})", "[domainServer] should be a string value"}, + {R"({"properties":{"rangeSet":{"items":{"properties":{"gateway":{"type":"string"}}}}}})", "[gateway] should be a string value"}, + {R"({"properties":{"rangeSet":{"items":{"properties":{"leaseTime":{"type":"integer"}}}}}})", "[leaseTime] should be an integer value"}, // {R"({"properties":{"rangeSet":{"items":{"properties":{"dhcpRange":{"type":"string","minLength":15}}}}}})", "Error in field [dhcpRange]"} }; diff --git a/unit_test/hardware/hardware_test.cpp b/unit_test/hardware/hardware_test.cpp index 612c2fc..3df6ba9 100644 --- a/unit_test/hardware/hardware_test.cpp +++ b/unit_test/hardware/hardware_test.cpp @@ -8,7 +8,7 @@ TEST_SUITE("Hardware functions") { TEST_CASE("CPU") { PCPU_INFO cpuInfo; - memset(cpuInfo, 0, sizeof(CPU_INFO)); + memset(&cpuInfo, 0, sizeof(PCPU_INFO)); cpu_watch_init(); diff --git a/unit_test/uthash/utarray_test.cpp b/unit_test/uthash/utarray_test.cpp index 89e358a..be26e9b 100644 --- a/unit_test/uthash/utarray_test.cpp +++ b/unit_test/uthash/utarray_test.cpp @@ -18,6 +18,7 @@ TEST_SUITE("UTArray") { TEST_CASE("PUSH") { PCOMBO p_combo; + memset(&p_combo, 0, sizeof(PCOMBO)); utarray_new(nums, &ut_combo_icd); @@ -37,6 +38,7 @@ TEST_SUITE("UTArray") { TEST_CASE("POP") { PCOMBO p_combo; + memset(&p_combo, 0, sizeof(PCOMBO)); MESSAGE("original len: ", utarray_len(nums)); while(utarray_len(nums) != 0) { p_combo = (PCOMBO)utarray_next(nums, p_combo);