From 23f0e4f7cdc5a03f44d7b204b7c78d51edc67eb7 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 9 Nov 2023 16:01:46 +0100 Subject: [PATCH] rand: Add tests. * tests/test-rand.c: New file. * modules/rand-tests: New file. --- ChangeLog | 4 ++++ modules/rand-tests | 11 +++++++++++ tests/test-rand.c | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 modules/rand-tests create mode 100644 tests/test-rand.c diff --git a/ChangeLog b/ChangeLog index a6e6a8045a..0c49471d04 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2023-11-09 Bruno Haible + rand: Add tests. + * tests/test-rand.c: New file. + * modules/rand-tests: New file. + rand: New module. * lib/rand.c: New file, based on glibc/stdlib/rand.c. * m4/rand.m4: New file. diff --git a/modules/rand-tests b/modules/rand-tests new file mode 100644 index 0000000000..0a2cb7e714 --- /dev/null +++ b/modules/rand-tests @@ -0,0 +1,11 @@ +Files: +tests/test-rand.c +tests/signature.h + +Depends-on: + +configure.ac: + +Makefile.am: +TESTS += test-rand +check_PROGRAMS += test-rand diff --git a/tests/test-rand.c b/tests/test-rand.c new file mode 100644 index 0000000000..eae68be611 --- /dev/null +++ b/tests/test-rand.c @@ -0,0 +1,33 @@ +/* Test rand. + Copyright (C) 2023 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 . */ + +#include + +/* Specification. */ +#include + +#include "signature.h" +SIGNATURE_CHECK (rand, int, (void)); + +int +main () +{ + rand (); + rand (); + rand (); + + return 0; +} -- 2.39.5