summaryrefslogtreecommitdiff
path: root/tests/test_core.py
diff options
context:
space:
mode:
authorLu Wang <coolwanglu@gmail.com>2013-11-27 00:27:02 +0800
committerLu Wang <coolwanglu@gmail.com>2013-11-27 00:27:02 +0800
commit31ae7a3a6ea6841f3eb93b23af1de328e2805e84 (patch)
treea8884c3a66aa9a5d18b6a48bc41c4194a4d086a1 /tests/test_core.py
parentd91ec3a7b38200705e11662d9d90b2c3a5f26cbd (diff)
fix rand_r; add rand_r in test_rand
Diffstat (limited to 'tests/test_core.py')
-rw-r--r--tests/test_core.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/test_core.py b/tests/test_core.py
index 099da365..4a3f57e8 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -6583,6 +6583,11 @@ int main()
srand(0xdeadbeef);
for(int i = 0; i < 10; ++i)
printf("%d\n", rand());
+
+ unsigned int seed = 0xdeadbeef;
+ for(int i = 0; i < 10; ++i)
+ printf("%d\n", rand_r(&seed));
+
return 0;
}
'''
@@ -6595,7 +6600,18 @@ int main()
983994184
1982845871
1210574360
-1479617503'''
+1479617503
+2073540312
+730128159
+1365227432
+1337224527
+792390264
+1952655743
+983994184
+1982845871
+1210574360
+1479617503
+'''
self.do_run(src, expected)
def test_strtod(self):