* 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.
2020-12-31 Bruno Haible <bruno@clisp.org>
+ 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.
--- /dev/null
+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
--- /dev/null
+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
--- /dev/null
+/* Test of <malloc.h> 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 <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2020. */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <malloc.h>
+
+#include "signature.h"
+
+
+#if GNULIB_TEST_MEMALIGN && HAVE_MEMALIGN
+SIGNATURE_CHECK (GNULIB_NAMESPACE::memalign, void *, (size_t, size_t));
+#endif
+
+
+int
+main ()
+{
+}
--- /dev/null
+/* Test of <malloc.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/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2020. */
+
+#include <config.h>
+
+#include <malloc.h>
+
+int
+main (void)
+{
+ return 0;
+}