projects
/
libc-test
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
50ab48b
)
lrand48 regression test
author
Szabolcs Nagy
<nsz@port70.net>
Sun, 21 Sep 2014 16:28:09 +0000
(18:28 +0200)
committer
Szabolcs Nagy
<nsz@port70.net>
Sun, 21 Sep 2014 16:28:09 +0000
(18:28 +0200)
src/regression/lrand48-signextend.c
[new file with mode: 0644]
patch
|
blob
diff --git a/src/regression/lrand48-signextend.c
b/src/regression/lrand48-signextend.c
new file mode 100644
(file)
index 0000000..
8a1dae6
--- /dev/null
+++ b/
src/regression/lrand48-signextend.c
@@ -0,0
+1,15
@@
+// lrand48 should give deterministic results
+#include <stdlib.h>
+#include "test.h"
+
+int main(void)
+{
+ long r;
+ r = lrand48();
+ if (r != 0) t_error("1st lrand48() got %ld want 0\n", r);
+ r = lrand48();
+ if (r != 2116118) t_error("2nd lrand48() got %ld want 2116118\n", r);
+ r = lrand48();
+ if (r != 89401895) t_error("3rd lrand48() got %ld want 89401895\n", r);
+ return t_status;
+}