diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-06 23:23:53 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:35:52 +0200 |
commit | 88ee912b36ba0f3e0ba0cd4f4506faaf3a175736 (patch) | |
tree | 0a5aed86cb230c044fc2f4c3539f35eac4f19b5b /tests/test_core.py | |
parent | b369cf755546f62ec1c0f4aa9216459b85bee8e7 (diff) |
Use do_run_from_file() for test_errar
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 7928adee..466ffcc6 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -946,34 +946,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_errar(self): - src = r''' - #include <stdio.h> - #include <errno.h> - #include <string.h> - - int main() { - char* err; - char buffer[200]; - - err = strerror(EDOM); - strerror_r(EWOULDBLOCK, buffer, 200); - printf("<%s>\n", err); - printf("<%s>\n", buffer); - - printf("<%d>\n", strerror_r(EWOULDBLOCK, buffer, 0)); - errno = 123; - printf("<%d>\n", errno); + test_path = path_from_root('tests', 'core', 'test_errar') + src, output = (test_path + s for s in ('.in', '.out')) - return 0; - } - ''' - expected = ''' - <Math arg out of domain of func> - <No more processes> - <34> - <123> - ''' - self.do_run(src, re.sub('(^|\n)\s+', '\\1', expected)) + self.do_run_from_file(src, output) def test_mainenv(self): src = ''' |