1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-09-01 02:34:55 +00:00

Reorganize C++ tests for stdbool and stdbool-c99.

* tests/test-stdbool-c++.cc: Don't include <stdbool.h> if TEST_STDBOOL_H
is not defined. Add a couple of simple tests, from test-stdbool.c.
* tests/test-stdbool-c99-c++.cc: New file.
* modules/stdbool-c99-c++-tests: New file, based on
modules/stdbool-c++-tests.
* modules/stdbool-c99-tests (Depends-on): Add stdbool-c99-c++-tests.
Remove stdbool-c++-tests.
* modules/stdbool-tests (Depends-on): Add stdbool-c++-tests.
This commit is contained in:
Bruno Haible
2022-09-10 20:01:24 +02:00
parent b4aa9d4076
commit 8b21d104b2
6 changed files with 56 additions and 3 deletions
+12
View File
@@ -1,3 +1,15 @@
2022-09-10 Bruno Haible <bruno@clisp.org>
Reorganize C++ tests for stdbool and stdbool-c99.
* tests/test-stdbool-c++.cc: Don't include <stdbool.h> if TEST_STDBOOL_H
is not defined. Add a couple of simple tests, from test-stdbool.c.
* tests/test-stdbool-c99-c++.cc: New file.
* modules/stdbool-c99-c++-tests: New file, based on
modules/stdbool-c++-tests.
* modules/stdbool-c99-tests (Depends-on): Add stdbool-c99-c++-tests.
Remove stdbool-c++-tests.
* modules/stdbool-tests (Depends-on): Add stdbool-c++-tests.
2022-09-10 Bruno Haible <bruno@clisp.org>
stdbool C++ tests: Fix for C++20.
+19
View File
@@ -0,0 +1,19 @@
Files:
tests/test-stdbool-c99-c++.cc
tests/test-stdbool-c++.cc
tests/test-stdbool-c++2.cc
Status:
c++-test
Depends-on:
ansi-c++-opt
configure.ac:
Makefile.am:
if ANSICXX
TESTS += test-stdbool-c99-c++
check_PROGRAMS += test-stdbool-c99-c++
test_stdbool_c99_c___SOURCES = test-stdbool-c99-c++.cc test-stdbool-c++2.cc
endif
+2 -2
View File
@@ -1,9 +1,9 @@
Files:
tests/test-stdbool.c
tests/test-stdbool-c99.c
tests/test-stdbool.c
Depends-on:
stdbool-c++-tests
stdbool-c99-c++-tests
configure.ac:
+1
View File
@@ -2,6 +2,7 @@ Files:
tests/test-stdbool.c
Depends-on:
stdbool-c++-tests
configure.ac:
+20 -1
View File
@@ -19,7 +19,26 @@
#define GNULIB_NAMESPACE gnulib
#include <config.h>
#include <stdbool.h>
#ifdef TEST_STDBOOL_H
# include <stdbool.h>
#endif
/* These tests are a subset of the C language tests in test-stdbool.c. */
#if false
"error: false is not 0"
#endif
#if true != 1
"error: true is not 1"
#endif
struct s { bool s: 1; bool t; } s;
char a[true == 1 ? 1 : -1];
char b[false == 0 ? 1 : -1];
char c[(unsigned char) true == 1 ? 1 : -1];
char d[(unsigned char) false == 0 ? 1 : -1];
int
+2
View File
@@ -0,0 +1,2 @@
#define TEST_STDBOOL_H
#include "test-stdbool-c++.cc"