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_strchroff.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_strchroff.c')
-rw-r--r-- | tests/test_str_strchroff.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/test_str_strchroff.c b/tests/test_str_strchroff.c index 805a96d..e8a6c0a 100644 --- a/tests/test_str_strchroff.c +++ b/tests/test_str_strchroff.c @@ -3,28 +3,28 @@ const char *testFmt = "case '%s': returned %d, expected %d\n"; struct TestCase testCase[] = { - {.inputValue.unsigned_integer = 'a', .caseValue.sptr = "after the world stops spinning", .truthValue.signed_integer = 0}, - {.inputValue.unsigned_integer = 'p', .caseValue.sptr = "apples exploded all over the place", .truthValue.signed_integer = 1}, - {.inputValue.unsigned_integer = '2', .caseValue.sptr = "a1a2a3a4a z!z@z#z$z a5a6a7a8a9", .truthValue.signed_integer = 3}, - {.inputValue.unsigned_integer = 'a', .caseValue.sptr = "aAaA", .truthValue.signed_integer = 0}, - {.inputValue.unsigned_integer = 'A', .caseValue.sptr = "aAaA", .truthValue.signed_integer = 1}, - {.inputValue.unsigned_integer = 'g', .caseValue.sptr = "abracadabra brisket gumball", .truthValue.signed_integer = 20}, - {.inputValue.unsigned_integer = 'r', .caseValue.sptr = "balloons are falling from the sky", .truthValue.signed_integer = 10}, - {.inputValue.unsigned_integer = 'b', .caseValue.sptr = "mangled mangoes oxidize quickly", .truthValue.signed_integer = -1}, - {.inputValue.unsigned_integer = 'b', .caseValue.sptr = "bBbB", .truthValue.signed_integer = 0}, - {.inputValue.unsigned_integer = 'B', .caseValue.sptr = "bBbB", .truthValue.signed_integer = 1}, + {.inputValue.unsigned_int = 'a', .caseValue.sptr = "after the world stops spinning", .truthValue.signed_int = 0}, + {.inputValue.unsigned_int = 'p', .caseValue.sptr = "apples exploded all over the place", .truthValue.signed_int = 1}, + {.inputValue.unsigned_int = '2', .caseValue.sptr = "a1a2a3a4a z!z@z#z$z a5a6a7a8a9", .truthValue.signed_int = 3}, + {.inputValue.unsigned_int = 'a', .caseValue.sptr = "aAaA", .truthValue.signed_int = 0}, + {.inputValue.unsigned_int = 'A', .caseValue.sptr = "aAaA", .truthValue.signed_int = 1}, + {.inputValue.unsigned_int = 'g', .caseValue.sptr = "abracadabra brisket gumball", .truthValue.signed_int = 20}, + {.inputValue.unsigned_int = 'r', .caseValue.sptr = "balloons are falling from the sky", .truthValue.signed_int = 10}, + {.inputValue.unsigned_int = 'b', .caseValue.sptr = "mangled mangoes oxidize quickly", .truthValue.signed_int = -1}, + {.inputValue.unsigned_int = 'b', .caseValue.sptr = "bBbB", .truthValue.signed_int = 0}, + {.inputValue.unsigned_int = 'B', .caseValue.sptr = "bBbB", .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 = strchroff(testCase[i].caseValue.sptr, testCase[i].inputValue.unsigned_integer); - myassert(result == testCase[i].truthValue.signed_integer, + int result = strchroff(testCase[i].caseValue.sptr, testCase[i].inputValue.unsigned_int); + myassert(result == testCase[i].truthValue.signed_int, testFmt, testCase[i].caseValue.sptr, result, - testCase[i].truthValue.signed_integer); + testCase[i].truthValue.signed_int); } return 0; |