13 lines
345 B
Plaintext
13 lines
345 B
Plaintext
main()
|
|
{
|
|
name = "strncmp";
|
|
|
|
test_int(strncmp("test", "test", 4), 0, "same chars");
|
|
test_int(strncmp("s", "b", 4), 17, "");
|
|
test_int(strncmp("", "", 4), 0, "empty strings");
|
|
test_int(strncmp("", "a", 0), 0, "");
|
|
test_int(strncmp("ab", "ac", 1), 0, "");
|
|
test_int(strncmp("aq", "a", 1), 0, "");
|
|
test_int(strncmp("aq", "a", 2), 113, "");
|
|
}
|