summaryrefslogtreecommitdiff
path: root/tests/test_core.py
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 13:45:30 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:35:57 +0200
commita929948ea5c9e88f9bbdbedaa91ccd6263419398 (patch)
treeec8523697c114450347cf86bfad27cc28777d687 /tests/test_core.py
parentb36947626b822900f070b0592bb1f3dc24c18774 (diff)
Use do_run_from_file() for test_strtoll_dec
Diffstat (limited to 'tests/test_core.py')
-rw-r--r--tests/test_core.py25
1 files changed, 3 insertions, 22 deletions
diff --git a/tests/test_core.py b/tests/test_core.py
index 35e91fac..097c4907 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -2365,29 +2365,10 @@ The current type of b is: 9
if self.emcc_args is None: return self.skip('requires emcc')
# tests strtoll for decimal strings (0x...)
- src = r'''
- #include <stdio.h>
- #include <stdlib.h>
-
- int main() {
- const char *STRING = "4 -38 +4711";
- char *end_char;
-
- // undefined base
- long long int l1 = strtoll(STRING, &end_char, 0);
- long long int l2 = strtoll(end_char, &end_char, 0);
- long long int l3 = strtoll(end_char, NULL, 0);
-
- // defined base
- long long int l4 = strtoll(STRING, &end_char, 10);
- long long int l5 = strtoll(end_char, &end_char, 10);
- long long int l6 = strtoll(end_char, NULL, 10);
+ test_path = path_from_root('tests', 'core', 'test_strtoll_dec')
+ src, output = (test_path + s for s in ('.in', '.out'))
- printf("%d%d%d%d%d%d\n", l1==4, l2==-38, l3==4711, l4==4, l5==-38, l6==4711);
- return 0;
- }
- '''
- self.do_run(src, '111111')
+ self.do_run_from_file(src, output)
def test_strtoll_bin(self):
if self.emcc_args is None: return self.skip('requires emcc')