>From ec9385e0feffe6257bba8c47a568fcdddb8d5772 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 31 Dec 2020 22:17:31 +0100 Subject: [PATCH 2/3] malloc-h: Add tests. * tests/test-malloc-h.c: New file. * modules/malloc-h-tests: New file. * tests/test-malloc-h-c++.cc: New file. * modules/malloc-h-c++-tests: New file. --- ChangeLog | 6 ++++++ modules/malloc-h-c++-tests | 18 ++++++++++++++++++ modules/malloc-h-tests | 11 +++++++++++ tests/test-malloc-h-c++.cc | 35 +++++++++++++++++++++++++++++++++++ tests/test-malloc-h.c | 27 +++++++++++++++++++++++++++ 5 files changed, 97 insertions(+) create mode 100644 modules/malloc-h-c++-tests create mode 100644 modules/malloc-h-tests create mode 100644 tests/test-malloc-h-c++.cc create mode 100644 tests/test-malloc-h.c diff --git a/ChangeLog b/ChangeLog index 3490bf5..bc173b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2020-12-31 Bruno Haible + malloc-h: Add tests. + * tests/test-malloc-h.c: New file. + * modules/malloc-h-tests: New file. + * tests/test-malloc-h-c++.cc: New file. + * modules/malloc-h-c++-tests: New file. + malloc-h: New module. * lib/malloc.in.h: New file. * m4/malloc_h.m4: New file. diff --git a/modules/malloc-h-c++-tests b/modules/malloc-h-c++-tests new file mode 100644 index 0000000..829f9e5 --- /dev/null +++ b/modules/malloc-h-c++-tests @@ -0,0 +1,18 @@ +Files: +tests/test-malloc-h-c++.cc +tests/signature.h + +Status: +c++-test + +Depends-on: +ansi-c++-opt + +configure.ac: + +Makefile.am: +if ANSICXX +TESTS += test-malloc-h-c++ +check_PROGRAMS += test-malloc-h-c++ +test_malloc_h_c___SOURCES = test-malloc-h-c++.cc +endif diff --git a/modules/malloc-h-tests b/modules/malloc-h-tests new file mode 100644 index 0000000..ab26943 --- /dev/null +++ b/modules/malloc-h-tests @@ -0,0 +1,11 @@ +Files: +tests/test-malloc-h.c + +Depends-on: +malloc-h-c++-tests + +configure.ac: + +Makefile.am: +TESTS += test-malloc-h +check_PROGRAMS += test-malloc-h diff --git a/tests/test-malloc-h-c++.cc b/tests/test-malloc-h-c++.cc new file mode 100644 index 0000000..3758f11 --- /dev/null +++ b/tests/test-malloc-h-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_MEMALIGN && HAVE_MEMALIGN +SIGNATURE_CHECK (GNULIB_NAMESPACE::memalign, void *, (size_t, size_t)); +#endif + + +int +main () +{ +} diff --git a/tests/test-malloc-h.c b/tests/test-malloc-h.c new file mode 100644 index 0000000..919fac3 --- /dev/null +++ b/tests/test-malloc-h.c @@ -0,0 +1,27 @@ +/* Test of 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 . */ + +/* Written by Bruno Haible , 2020. */ + +#include + +#include + +int +main (void) +{ + return 0; +} -- 2.7.4