diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 13:55:46 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:35:57 +0200 |
commit | 38ad629ca30add842a91de7e1346380741707fd2 (patch) | |
tree | 59e3e26b1b392ade0b56a53937c3b32247e2e374 /tests/test_core.py | |
parent | 9d525831447f3897a69cbe51fb2eec54f86e43c6 (diff) |
Use do_run_from_file() for test_strtol_oct
Diffstat (limited to 'tests/test_core.py')
-rw-r--r-- | tests/test_core.py | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/tests/test_core.py b/tests/test_core.py index c3663f4c..64a195e1 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -2411,29 +2411,10 @@ The current type of b is: 9 def test_strtol_oct(self): # tests strtoll for decimal strings (0x...) - src = r''' - #include <stdio.h> - #include <stdlib.h> - - int main() { - const char *STRING = "0 -035 +04711"; - char *end_char; - - // undefined base - long l1 = strtol(STRING, &end_char, 0); - long l2 = strtol(end_char, &end_char, 0); - long l3 = strtol(end_char, NULL, 0); - - // defined base - long l4 = strtol(STRING, &end_char, 8); - long l5 = strtol(end_char, &end_char, 8); - long l6 = strtol(end_char, NULL, 8); + test_path = path_from_root('tests', 'core', 'test_strtol_oct') + src, output = (test_path + s for s in ('.in', '.out')) - printf("%d%d%d%d%d%d\n", l1==0, l2==-29, l3==2505, l4==0, l5==-29, l6==2505); - return 0; - } - ''' - self.do_run(src, '111111') + self.do_run_from_file(src, output) def test_atexit(self): # Confirms they are called in reverse order |