diff options
Diffstat (limited to 'src/cutest_slib.c')
-rw-r--r-- | src/cutest_slib.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/cutest_slib.c b/src/cutest_slib.c index 1e0e6c4..4350815 100644 --- a/src/cutest_slib.c +++ b/src/cutest_slib.c @@ -57,6 +57,27 @@ void Test_sl_snprintf (CuTest *tc) { CuAssertTrue(tc, input[4] == 'X'); } +void Test_sl_ts_strncmp (CuTest *tc) { + char one[64], two[64]; + int res; + + strcpy(one, "foo"); + strcpy(two, "foo"); + res = sl_ts_strncmp(one, two, 3); + CuAssertIntEquals(tc, 0, res); + + strcpy(one, "fox"); + strcpy(two, "foo"); + res = sl_ts_strncmp(one, two, 2); + CuAssertIntEquals(tc, 0, res); + + strcpy(one, "f9o"); + strcpy(two, "foo"); + res = sl_ts_strncmp(one, two, 3); + CuAssertTrue(tc, 0 != res); + +} + void Test_sl_strcasecmp (CuTest *tc) { char one[64], two[64]; int res; |