]> Savannah Git Hosting - gnulib.git/commitdiff
sys_random: Add tests.
authorBruno Haible <bruno@clisp.org>
Sat, 30 May 2020 14:20:32 +0000 (16:20 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 30 May 2020 14:20:32 +0000 (16:20 +0200)
* tests/test-sys_random.c: New file.
* modules/sys_random-tests: New file.

ChangeLog
modules/sys_random-tests [new file with mode: 0644]
tests/test-sys_random.c [new file with mode: 0644]

index 3c4dd93b7cfb22085df54aacbfeab92f75615915..f458e9dc12918bdac3bf4a194d5893f7101a1c3d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2020-05-30  Bruno Haible  <bruno@clisp.org>
 
+       sys_random: Add tests.
+       * tests/test-sys_random.c: New file.
+       * modules/sys_random-tests: New file.
+
        sys_random: New module.
        * lib/sys_random.in.h: Use the common idioms for overridable header
        files.
diff --git a/modules/sys_random-tests b/modules/sys_random-tests
new file mode 100644 (file)
index 0000000..24fea63
--- /dev/null
@@ -0,0 +1,10 @@
+Files:
+tests/test-sys_random.c
+
+Depends-on:
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-sys_random
+check_PROGRAMS += test-sys_random
diff --git a/tests/test-sys_random.c b/tests/test-sys_random.c
new file mode 100644 (file)
index 0000000..56da27b
--- /dev/null
@@ -0,0 +1,32 @@
+/* Test of <sys/random.h> substitute.
+   Copyright (C) 2020 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <sys/random.h>
+
+/* Check that the necessary constants are defined.  */
+int flags[] =
+  {
+    GRND_RANDOM,
+    GRND_NONBLOCK
+  };
+
+int
+main (void)
+{
+  return 0;
+}