diff options
Diffstat (limited to 'tests/test_core.py')
-rw-r--r-- | tests/test_core.py | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/tests/test_core.py b/tests/test_core.py index 7b9cd750..911c7a68 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1538,34 +1538,10 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co self.do_run_from_file(src, output) def test_funcptr_namecollide(self): - src = r''' - #include <stdio.h> - - void do_call(void (*puts)(const char *), const char *str); - - void do_print(const char *str) { - if (!str) do_call(NULL, "delusion"); - if ((int)str == -1) do_print(str+10); - puts("===="); - puts(str); - puts("===="); - } - - void do_call(void (*puts)(const char *), const char *str) { - if (!str) do_print("confusion"); - if ((int)str == -1) do_call(NULL, str-10); - (*puts)(str); - } + test_path = path_from_root('tests', 'core', 'test_funcptr_namecollide') + src, output = (test_path + s for s in ('.in', '.out')) - int main(int argc, char **argv) - { - for (int i = 0; i < argc; i++) { - do_call(i != 10 ? do_print : NULL, i != 15 ? "waka waka" : NULL); - } - return 0; - } - ''' - self.do_run(src, 'waka', force_c=True) + self.do_run_from_file(src, output, force_c=True) def test_emptyclass(self): if self.emcc_args is None: return self.skip('requires emcc') |