Lines Matching refs:TEST

39 #define TEST(r, f, x, m) do {                                           \  macro
63 TEST(s, strcpy(b, b+16), b, "wrong return %p != %p"); in test_string()
65 TEST(s, strcpy(b+1, b+16), b+1, "wrong return %p != %p"); in test_string()
67 TEST(s, strcpy(b+2, b+16), b+2, "wrong return %p != %p"); in test_string()
69 TEST(s, strcpy(b+3, b+16), b+3, "wrong return %p != %p"); in test_string()
72 TEST(s, strcpy(b+1, b+17), b+1, "wrong return %p != %p"); in test_string()
74 TEST(s, strcpy(b+2, b+18), b+2, "wrong return %p != %p"); in test_string()
76 TEST(s, strcpy(b+3, b+19), b+3, "wrong return %p != %p"); in test_string()
79 TEST(s, memset(b, 'x', sizeof b), b, "wrong return %p != %p"); in test_string()
80 TEST(s, strncpy(b, "abc", sizeof b - 1), b, "wrong return %p != %p"); in test_string()
81 TEST(i, memcmp(b, "abc\0\0\0\0", 8), 0, "strncpy fails to zero-pad dest"); in test_string()
82 TEST(i, b[sizeof b - 1], 'x', "strncpy overruns buffer when n > strlen(src)"); in test_string()
86 TEST(i, b[2], 'c', "strncpy fails to copy last byte: %hhu != %hhu"); in test_string()
87 TEST(i, b[3], 'x', "strncpy overruns buffer to null-terminate: %hhu != %hhu"); in test_string()
89 TEST(i, !strncmp("abcd", "abce", 3), 1, "strncmp compares past n"); in test_string()
90 TEST(i, !!strncmp("abc", "abd", 3), 1, "strncmp fails to compare n-1st byte"); in test_string()
93 TEST(s, strncat(b, "123456", 3), b, "%p != %p"); in test_string()
94 TEST(i, b[6], 0, "strncat failed to null-terminate (%d)"); in test_string()
98 TEST(s, strchr(b, 'b'), b+3, "%p != %p"); in test_string()
99 TEST(s, strrchr(b, 'b'), b+5, "%p != %p"); in test_string()
100 TEST(i, strspn(b, "abcd"), 10, "%d != %d"); in test_string()
101 TEST(i, strcspn(b, "0123"), 10, "%d != %d"); in test_string()
102 TEST(s, strpbrk(b, "0123"), b+10, "%p != %p"); in test_string()
105 TEST(s, strtok(b, " "), b, "%p != %p"); in test_string()
108 TEST(s, strtok(NULL, ";"), b+4, "%p != %p"); in test_string()
111 TEST(s, strtok(NULL, " ;"), b+11, "%p != %p"); in test_string()
114 TEST(s, strtok(NULL, " ;"), b+16, "%p != %p"); in test_string()
119 TEST(i, strlcpy(b, "abc", sizeof b - 1), 3, "length %d != %d"); in test_string()
120 TEST(i, b[3], 0, "strlcpy did not null-terminate short string (%d)"); in test_string()
121 TEST(i, b[4], 'x', "strlcpy wrote extra bytes (%d)"); in test_string()
124 TEST(i, strlcpy(b, "abc", 2), 3, "length %d != %d"); in test_string()
125 TEST(i, b[0], 'a', "strlcpy did not copy character %d"); in test_string()
126 TEST(i, b[1], 0, "strlcpy did not null-terminate long string (%d)"); in test_string()
129 TEST(i, strlcpy(b, "abc", 3), 3, "length %d != %d"); in test_string()
130 TEST(i, b[2], 0, "strlcpy did not null-terminate l-length string (%d)"); in test_string()
132 TEST(i, strlcpy(NULL, "abc", 0), 3, "length %d != %d"); in test_string()
135 TEST(i, strlcat(b, "123", sizeof b), 6, "length %d != %d"); in test_string()
139 TEST(i, strlcat(b, "123", 6), 6, "length %d != %d"); in test_string()
141 TEST(i, b[6], 'x', "strlcat wrote past string %d != %d"); in test_string()
144 TEST(i, strlcat(b, "123", 4), 6, "length %d != %d"); in test_string()
148 TEST(i, strlcat(b, "123", 3), 6, "length %d != %d"); in test_string()