diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-06 23:17:00 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:35:52 +0200 |
commit | f70f993a856b0ddbef73cefc24f3dafc4cc4e292 (patch) | |
tree | 6460981073ad199f19586d81666afc1fad2142f7 /tests | |
parent | 63646b8d11d323c4fe575058135c8c63b814b007 (diff) |
Use do_run_from_file() for test_strcmp_uni
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/test_strcmp_uni.in | 11 | ||||
-rw-r--r-- | tests/core/test_strcmp_uni.out | 3 | ||||
-rw-r--r-- | tests/test_core.py | 22 |
3 files changed, 18 insertions, 18 deletions
diff --git a/tests/core/test_strcmp_uni.in b/tests/core/test_strcmp_uni.in new file mode 100644 index 00000000..4ccd7db8 --- /dev/null +++ b/tests/core/test_strcmp_uni.in @@ -0,0 +1,11 @@ + + #include <stdio.h> + #include <string.h> + int main() + { + #define TEST(func) { char *word = "WORD"; char wordEntry[2] = { -61,-126 }; /* "Â"; */ int cmp = func(word, wordEntry, 2); printf("Compare value " #func " is %d\n", cmp); } + TEST(strncmp); + TEST(strncasecmp); + TEST(memcmp); + } +
\ No newline at end of file diff --git a/tests/core/test_strcmp_uni.out b/tests/core/test_strcmp_uni.out new file mode 100644 index 00000000..58e237d7 --- /dev/null +++ b/tests/core/test_strcmp_uni.out @@ -0,0 +1,3 @@ +Compare value strncmp is -1 +Compare value strncasecmp is -1 +Compare value memcmp is -1 diff --git a/tests/test_core.py b/tests/test_core.py index e77ddbbf..a1a41b9a 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -934,24 +934,10 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co assert ('var __str1;' in gen) == named def test_strcmp_uni(self): - src = ''' - #include <stdio.h> - #include <string.h> - int main() - { - #define TEST(func) \ - { \ - char *word = "WORD"; \ - char wordEntry[2] = { -61,-126 }; /* "Â"; */ \ - 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 strncmp is -1\nCompare value strncasecmp is -1\nCompare value memcmp is -1\n') + test_path = path_from_root('tests', 'core', 'test_strcmp_uni') + src, output = (test_path + s for s in ('.in', '.out')) + + self.do_run_from_file(src, output) def test_strndup(self): src = ''' |