forked from github/server
fix compilation on ARM (differnt char type)
This commit is contained in:
parent
9f04f80f45
commit
0eae68f34e
|
@ -62,16 +62,16 @@ static void test_regionid(CuTest * tc) {
|
||||||
plain = test_create_terrain("plain", 0);
|
plain = test_create_terrain("plain", 0);
|
||||||
r = test_create_region(0, 0, plain);
|
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));
|
len = f_regionid(r, 0, buffer, sizeof(buffer));
|
||||||
CuAssertIntEquals(tc, 11, len);
|
CuAssertIntEquals(tc, 11, len);
|
||||||
CuAssertStrEquals(tc, "plain (0,0)", buffer);
|
CuAssertStrEquals(tc, "plain (0,0)", buffer);
|
||||||
|
|
||||||
memset(buffer, -1, sizeof(buffer));
|
memset(buffer, -2, sizeof(buffer));
|
||||||
len = f_regionid(r, 0, buffer, 11);
|
len = f_regionid(r, 0, buffer, 11);
|
||||||
CuAssertIntEquals(tc, 10, len);
|
CuAssertIntEquals(tc, 10, len);
|
||||||
CuAssertStrEquals(tc, "plain (0,0", buffer);
|
CuAssertStrEquals(tc, "plain (0,0", buffer);
|
||||||
CuAssertIntEquals(tc, -1, buffer[11]);
|
CuAssertIntEquals(tc, (char)-2, buffer[11]);
|
||||||
}
|
}
|
||||||
|
|
||||||
CuSuite *get_reports_suite(void)
|
CuSuite *get_reports_suite(void)
|
||||||
|
|
|
@ -15,11 +15,11 @@ static void test_strlcat(CuTest * tc)
|
||||||
buffer[0] = '\0';
|
buffer[0] = '\0';
|
||||||
CuAssertIntEquals(tc, 4, strlcat(buffer, "herp", 8));
|
CuAssertIntEquals(tc, 4, strlcat(buffer, "herp", 8));
|
||||||
CuAssertStrEquals(tc, "herp", buffer);
|
CuAssertStrEquals(tc, "herp", buffer);
|
||||||
CuAssertIntEquals(tc, -2, buffer[5]);
|
CuAssertIntEquals(tc, (char)-2, buffer[5]);
|
||||||
|
|
||||||
CuAssertIntEquals(tc, 8, strlcat(buffer, "derp", 8));
|
CuAssertIntEquals(tc, 8, strlcat(buffer, "derp", 8));
|
||||||
CuAssertStrEquals(tc, "herpder", buffer);
|
CuAssertStrEquals(tc, "herpder", buffer);
|
||||||
CuAssertIntEquals(tc, -2, buffer[8]);
|
CuAssertIntEquals(tc, (char)-2, buffer[8]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_strlcpy(CuTest * tc)
|
static void test_strlcpy(CuTest * tc)
|
||||||
|
@ -33,11 +33,11 @@ static void test_strlcpy(CuTest * tc)
|
||||||
|
|
||||||
CuAssertIntEquals(tc, 4, strlcpy(buffer, "herp", 8));
|
CuAssertIntEquals(tc, 4, strlcpy(buffer, "herp", 8));
|
||||||
CuAssertStrEquals(tc, "herp", buffer);
|
CuAssertStrEquals(tc, "herp", buffer);
|
||||||
CuAssertIntEquals(tc, -2, buffer[5]);
|
CuAssertIntEquals(tc, (char)-2, buffer[5]);
|
||||||
|
|
||||||
CuAssertIntEquals(tc, 8, strlcpy(buffer, "herpderp", 8));
|
CuAssertIntEquals(tc, 8, strlcpy(buffer, "herpderp", 8));
|
||||||
CuAssertStrEquals(tc, "herpder", buffer);
|
CuAssertStrEquals(tc, "herpder", buffer);
|
||||||
CuAssertIntEquals(tc, -2, buffer[8]);
|
CuAssertIntEquals(tc, (char)-2, buffer[8]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_slprintf(CuTest * tc)
|
static void test_slprintf(CuTest * tc)
|
||||||
|
@ -51,11 +51,11 @@ static void test_slprintf(CuTest * tc)
|
||||||
|
|
||||||
CuAssertIntEquals(tc, 4, slprintf(buffer, 8, "%s", "herp"));
|
CuAssertIntEquals(tc, 4, slprintf(buffer, 8, "%s", "herp"));
|
||||||
CuAssertStrEquals(tc, "herp", buffer);
|
CuAssertStrEquals(tc, "herp", buffer);
|
||||||
CuAssertIntEquals(tc, -2, buffer[5]);
|
CuAssertIntEquals(tc, (char)-2, buffer[5]);
|
||||||
|
|
||||||
CuAssertIntEquals(tc, 8, slprintf(buffer, 8, "%s", "herpderp"));
|
CuAssertIntEquals(tc, 8, slprintf(buffer, 8, "%s", "herpderp"));
|
||||||
CuAssertStrEquals(tc, "herpder", buffer);
|
CuAssertStrEquals(tc, "herpder", buffer);
|
||||||
CuAssertIntEquals(tc, -2, buffer[8]);
|
CuAssertIntEquals(tc, (char)-2, buffer[8]);
|
||||||
}
|
}
|
||||||
|
|
||||||
CuSuite *get_bsdstring_suite(void)
|
CuSuite *get_bsdstring_suite(void)
|
||||||
|
|
Loading…
Reference in New Issue