summaryrefslogtreecommitdiff
path: root/tests/test_core.py
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-06 23:17:00 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:35:52 +0200
commitf70f993a856b0ddbef73cefc24f3dafc4cc4e292 (patch)
tree6460981073ad199f19586d81666afc1fad2142f7 /tests/test_core.py
parent63646b8d11d323c4fe575058135c8c63b814b007 (diff)
Use do_run_from_file() for test_strcmp_uni
Diffstat (limited to 'tests/test_core.py')
-rw-r--r--tests/test_core.py22
1 files changed, 4 insertions, 18 deletions
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 = '''