tests: introduced sanity checks in rng-fork

parent 35fb5a0e
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#include <assert.h>
#if !defined(_WIN32) #if !defined(_WIN32)
#include <sys/wait.h> #include <sys/wait.h>
#endif #endif
...@@ -67,7 +68,7 @@ void doit(void) ...@@ -67,7 +68,7 @@ void doit(void)
if (fp == NULL) if (fp == NULL)
fail("cannot open file"); fail("cannot open file");
gnutls_rnd(i, buf1, sizeof(buf1)); assert(gnutls_rnd(i, buf1, sizeof(buf1)) >= 0);
if (debug) if (debug)
dump("buf1", buf1, sizeof(buf1)); dump("buf1", buf1, sizeof(buf1));
...@@ -77,7 +78,7 @@ void doit(void) ...@@ -77,7 +78,7 @@ void doit(void)
exit(0); exit(0);
} else { } else {
/* daddy */ /* daddy */
gnutls_rnd(i, buf2, sizeof(buf2)); assert(gnutls_rnd(i, buf2, sizeof(buf2)) >= 0);
if (debug) if (debug)
dump("buf2", buf2, sizeof(buf2)); dump("buf2", buf2, sizeof(buf2));
waitpid(pid, NULL, 0); waitpid(pid, NULL, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment