aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorkripken <alonzakai@gmail.com>2011-07-14 14:38:43 -0700
committerkripken <alonzakai@gmail.com>2011-07-14 14:38:43 -0700
commit2c4fcf084653305f47dc0cef26f60df94b3ded13 (patch)
tree7b0f9cda9cfd5e5575c3b6fa51c361c01752fd6c /tests/runner.py
parent8672034800dc463c5f5bffa95b3de9963e161788 (diff)
parent1e8f828cb5f2c3c60ab5b982590df5cb7bb6a19b (diff)
Merge pull request #53 from max99x/master
Error codes and messages
Diffstat (limited to 'tests/runner.py')
-rw-r--r--tests/runner.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 797b78f9..1e8828a0 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -677,6 +677,36 @@ if 'benchmark' not in sys.argv:
'''
self.do_test(src, '3:10,177,543\n4\nwowie\ntoo\n76\n5\n(null)\n/* a comment */\n// another', ['wowie', 'too', '74'])
+ def test_error(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);
+
+ return 0;
+ }
+ '''
+ expected = '''
+ <Numerical argument out of domain>
+ <Resource temporarily unavailable>
+ <34>
+ <123>
+ '''
+ self.do_test(src, re.sub('(^|\n)\s+', '\\1', expected))
+
def test_mainenv(self):
src = '''
#include <stdio.h>