diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-08-14 11:47:15 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-08-14 11:47:15 -0700 |
commit | 149f063107024f61295ceef6e5905f8123c490b7 (patch) | |
tree | 275c75aee12cd0f04c2ffeae3ff40ddd08eac9bd /tests | |
parent | 173b8830def7800dc3caec992b7c7b7e2139bb73 (diff) |
fix sign checks in strncasecmp and memcmp
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/runner.py b/tests/runner.py index c7a53e25..b80509ff 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -1493,13 +1493,19 @@ c5,de,15,8a #include <string.h> int main() { - char *word = "WORD"; - char *wordEntry = "Â"; - int cmp = strncmp(word, wordEntry, 2); - printf("Compare value is %d\\n", cmp); + #define TEST(func) \ + { \ + char *word = "WORD"; \ + char *wordEntry = "Â"; \ + int cmp = func(word, wordEntry, 2); \ + printf("Compare value " #func " is %d\\n", cmp); \ + } + TEST(strncmp); + TEST(strncasecmp); + TEST(memcmp); } ''' - self.do_run(src, 'Compare value is -1\n') + self.do_run(src, 'Compare value strncmp is -1\nCompare value strncasecmp is -1\nCompare value memcmp is -1\n') def test_strndup(self): src = ''' |