>From 9e7d098310117f0b17e7868124652a392b0a9854 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 30 May 2020 16:22:25 +0200 Subject: [PATCH 3/3] sys_random: Add C++ tests. * tests/test-sys_random-c++.cc: New file. * modules/sys_random-c++-tests: New file. * modules/sys_random-tests (Depends-on): Depend on it. --- ChangeLog | 5 +++++ modules/sys_random-c++-tests | 18 ++++++++++++++++++ modules/sys_random-tests | 1 + tests/test-sys_random-c++.cc | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 modules/sys_random-c++-tests create mode 100644 tests/test-sys_random-c++.cc diff --git a/ChangeLog b/ChangeLog index f458e9d..c5a3bd5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2020-05-30 Bruno Haible + sys_random: Add C++ tests. + * tests/test-sys_random-c++.cc: New file. + * modules/sys_random-c++-tests: New file. + * modules/sys_random-tests (Depends-on): Depend on it. + sys_random: Add tests. * tests/test-sys_random.c: New file. * modules/sys_random-tests: New file. diff --git a/modules/sys_random-c++-tests b/modules/sys_random-c++-tests new file mode 100644 index 0000000..e07d81f --- /dev/null +++ b/modules/sys_random-c++-tests @@ -0,0 +1,18 @@ +Files: +tests/test-sys_random-c++.cc +tests/signature.h + +Status: +c++-test + +Depends-on: +ansi-c++-opt + +configure.ac: + +Makefile.am: +if ANSICXX +TESTS += test-sys_random-c++ +check_PROGRAMS += test-sys_random-c++ +test_sys_random_c___SOURCES = test-sys_random-c++.cc +endif diff --git a/modules/sys_random-tests b/modules/sys_random-tests index 24fea63..2208c5a 100644 --- a/modules/sys_random-tests +++ b/modules/sys_random-tests @@ -2,6 +2,7 @@ Files: tests/test-sys_random.c Depends-on: +sys_random-c++-tests configure.ac: diff --git a/tests/test-sys_random-c++.cc b/tests/test-sys_random-c++.cc new file mode 100644 index 0000000..7477b3a --- /dev/null +++ b/tests/test-sys_random-c++.cc @@ -0,0 +1,35 @@ +/* Test of substitute in C++ mode. + 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 . */ + +/* Written by Bruno Haible , 2020. */ + +#define GNULIB_NAMESPACE gnulib +#include + +#include + +#include "signature.h" + + +#if GNULIB_TEST_GETRANDOM +SIGNATURE_CHECK (GNULIB_NAMESPACE::getrandom, ssize_t, (void *, size_t, unsigned int)); +#endif + + +int +main () +{ +} -- 2.7.4