diff options
author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2020-04-28 14:27:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-28 14:27:31 -0400 |
commit | bdd8485de4cde8dba67b27146feda5fd821cd7ef (patch) | |
tree | 1f87a54f617b7054c2bb7b66e4e30488c40268f4 /tests/test_str_startswith.c | |
parent | 338abde356efcae6cf0a000b71b781d21c8733b6 (diff) | |
parent | 428849beb3be85cf69f3ca3029d330ee2f2d842f (diff) | |
download | spmc-bdd8485de4cde8dba67b27146feda5fd821cd7ef.tar.gz |
Merge pull request #31 from jhunkeler/strlist-helpers
Strlist helpers
Diffstat (limited to 'tests/test_str_startswith.c')
-rw-r--r-- | tests/test_str_startswith.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/test_str_startswith.c b/tests/test_str_startswith.c index da25341..1346865 100644 --- a/tests/test_str_startswith.c +++ b/tests/test_str_startswith.c @@ -3,20 +3,20 @@ const char *testFmt = "'%s' does not start with '%s' (%d)\n"; struct TestCase testCase[] = { - {.inputValue.sptr = "abra", .caseValue.sptr = "abracadabra brisket gumball", .truthValue.signed_integer = 1}, - {.inputValue.sptr = "ball", .caseValue.sptr = "balloons are falling from the sky", .truthValue.signed_integer = 1}, - {.inputValue.sptr = "mangle", .caseValue.sptr = "mangled mangoes oxidize quickly", .truthValue.signed_integer = 1}, - {.inputValue.sptr = "b", .caseValue.sptr = "bBbB", .truthValue.signed_integer = 1}, - {.inputValue.sptr = NULL, .caseValue.sptr = "bBbB", .truthValue.signed_integer = -1}, - {.inputValue.sptr = "test", .caseValue.sptr = NULL, .truthValue.signed_integer = -1}, - {.inputValue.sptr = NULL, .caseValue.sptr = NULL, .truthValue.signed_integer = -1}, + {.inputValue.sptr = "abra", .caseValue.sptr = "abracadabra brisket gumball", .truthValue.signed_int = 1}, + {.inputValue.sptr = "ball", .caseValue.sptr = "balloons are falling from the sky", .truthValue.signed_int = 1}, + {.inputValue.sptr = "mangle", .caseValue.sptr = "mangled mangoes oxidize quickly", .truthValue.signed_int = 1}, + {.inputValue.sptr = "b", .caseValue.sptr = "bBbB", .truthValue.signed_int = 1}, + {.inputValue.sptr = NULL, .caseValue.sptr = "bBbB", .truthValue.signed_int = -1}, + {.inputValue.sptr = "test", .caseValue.sptr = NULL, .truthValue.signed_int = -1}, + {.inputValue.sptr = NULL, .caseValue.sptr = NULL, .truthValue.signed_int = -1}, }; size_t numCases = sizeof(testCase) / sizeof(struct TestCase); int main(int argc, char *argv[]) { for (size_t i = 0; i < numCases; i++) { int result = startswith(testCase[i].caseValue.sptr, testCase[i].inputValue.sptr); - myassert(result == testCase[i].truthValue.signed_integer, testFmt, testCase[i].inputValue.str, testCase[i].truthValue.sptr, result); + myassert(result == testCase[i].truthValue.signed_int, testFmt, testCase[i].inputValue.str, testCase[i].truthValue.sptr, result); } return 0; }
\ No newline at end of file |