]> Savannah Git Hosting - gnulib.git/commitdiff
byteswap tests: Verify header can be used from C++.
authorCollin Funk <collin.funk1@gmail.com>
Sat, 25 May 2024 08:20:01 +0000 (01:20 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Sat, 25 May 2024 08:20:01 +0000 (01:20 -0700)
* modules/byteswap-c++-tests: New file.
* tests/test-byteswap-c++.cc: New file.
* modules/byteswap-tests (Depends-on): Add byteswap-c++-tests.

ChangeLog
modules/byteswap-c++-tests [new file with mode: 0644]
modules/byteswap-tests
tests/test-byteswap-c++.cc [new file with mode: 0644]

index 0a6def457df7e9fa56bd7e45e8b75abeefebda77..52d51ba5a77728446be375ac1d6c9e51a03151f6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-05-25  Collin Funk  <collin.funk1@gmail.com>
+
+       byteswap tests: Verify header can be used from C++.
+       * modules/byteswap-c++-tests: New file.
+       * tests/test-byteswap-c++.cc: New file.
+       * modules/byteswap-tests (Depends-on): Add byteswap-c++-tests.
+
 2024-05-24  Collin Funk  <collin.funk1@gmail.com>
 
        readutmp: Fix dependencies.
diff --git a/modules/byteswap-c++-tests b/modules/byteswap-c++-tests
new file mode 100644 (file)
index 0000000..05cdc94
--- /dev/null
@@ -0,0 +1,17 @@
+Files:
+tests/test-byteswap-c++.cc
+
+Status:
+c++-test
+
+Depends-on:
+ansi-c++-opt
+
+configure.ac:
+
+Makefile.am:
+if ANSICXX
+TESTS += test-byteswap-c++
+check_PROGRAMS += test-byteswap-c++
+test_byteswap_c___SOURCES = test-byteswap-c++.cc
+endif
index 64baf0e404504be8216e98166b6ee6e47ba9e9a7..e148c5f7f300ba9520f32ac60a3d524864972172 100644 (file)
@@ -4,6 +4,7 @@ tests/macros.h
 
 Depends-on:
 stdint
+byteswap-c++-tests
 
 configure.ac:
 
diff --git a/tests/test-byteswap-c++.cc b/tests/test-byteswap-c++.cc
new file mode 100644 (file)
index 0000000..8276840
--- /dev/null
@@ -0,0 +1,27 @@
+/* Test the <byteswap.h> substitute in C++ mode.
+   Copyright (C) 2024 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 Collin Funk <collin.funk1@gmail.com>, 2024.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <byteswap.h>
+
+int
+main ()
+{
+}