diff --git a/src/kernel/reports_test.c b/src/kernel/reports_test.c index c3ee0c3c1..0bfa47e34 100644 --- a/src/kernel/reports_test.c +++ b/src/kernel/reports_test.c @@ -62,16 +62,16 @@ static void test_regionid(CuTest * tc) { plain = test_create_terrain("plain", 0); r = test_create_region(0, 0, plain); - memset(buffer, 0xff, sizeof(buffer)); + memset(buffer, -2, sizeof(buffer)); len = f_regionid(r, 0, buffer, sizeof(buffer)); CuAssertIntEquals(tc, 11, len); CuAssertStrEquals(tc, "plain (0,0)", buffer); - memset(buffer, -1, sizeof(buffer)); + memset(buffer, -2, sizeof(buffer)); len = f_regionid(r, 0, buffer, 11); CuAssertIntEquals(tc, 10, len); CuAssertStrEquals(tc, "plain (0,0", buffer); - CuAssertIntEquals(tc, -1, buffer[11]); + CuAssertIntEquals(tc, (char)-2, buffer[11]); } CuSuite *get_reports_suite(void) diff --git a/src/util/bsdstring_test.c b/src/util/bsdstring_test.c index 25e7be60d..0f9cdaeac 100644 --- a/src/util/bsdstring_test.c +++ b/src/util/bsdstring_test.c @@ -15,11 +15,11 @@ static void test_strlcat(CuTest * tc) buffer[0] = '\0'; CuAssertIntEquals(tc, 4, strlcat(buffer, "herp", 8)); CuAssertStrEquals(tc, "herp", buffer); - CuAssertIntEquals(tc, -2, buffer[5]); + CuAssertIntEquals(tc, (char)-2, buffer[5]); CuAssertIntEquals(tc, 8, strlcat(buffer, "derp", 8)); CuAssertStrEquals(tc, "herpder", buffer); - CuAssertIntEquals(tc, -2, buffer[8]); + CuAssertIntEquals(tc, (char)-2, buffer[8]); } static void test_strlcpy(CuTest * tc) @@ -33,11 +33,11 @@ static void test_strlcpy(CuTest * tc) CuAssertIntEquals(tc, 4, strlcpy(buffer, "herp", 8)); CuAssertStrEquals(tc, "herp", buffer); - CuAssertIntEquals(tc, -2, buffer[5]); + CuAssertIntEquals(tc, (char)-2, buffer[5]); CuAssertIntEquals(tc, 8, strlcpy(buffer, "herpderp", 8)); CuAssertStrEquals(tc, "herpder", buffer); - CuAssertIntEquals(tc, -2, buffer[8]); + CuAssertIntEquals(tc, (char)-2, buffer[8]); } static void test_slprintf(CuTest * tc) @@ -51,11 +51,11 @@ static void test_slprintf(CuTest * tc) CuAssertIntEquals(tc, 4, slprintf(buffer, 8, "%s", "herp")); CuAssertStrEquals(tc, "herp", buffer); - CuAssertIntEquals(tc, -2, buffer[5]); + CuAssertIntEquals(tc, (char)-2, buffer[5]); CuAssertIntEquals(tc, 8, slprintf(buffer, 8, "%s", "herpderp")); CuAssertStrEquals(tc, "herpder", buffer); - CuAssertIntEquals(tc, -2, buffer[8]); + CuAssertIntEquals(tc, (char)-2, buffer[8]); } CuSuite *get_bsdstring_suite(void)