]> Savannah Git Hosting - gnulib.git/commitdiff
net_if: Add C++ tests.
authorBruno Haible <bruno@clisp.org>
Sat, 3 Sep 2022 18:21:37 +0000 (20:21 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 3 Sep 2022 18:29:14 +0000 (20:29 +0200)
* tests/test-net_if-c++.cc: New file.
* modules/net_if-c++-tests: New file.
* modules/net_if-tests (Depends-on): Add net_if-c++-tests.
* doc/posix-headers/net_if.texi: Fix documentation.

ChangeLog
doc/posix-headers/net_if.texi
modules/net_if-c++-tests [new file with mode: 0644]
modules/net_if-tests
tests/test-net_if-c++.cc [new file with mode: 0644]

index b81480470aed5b71096852684e93b69463fdd873..f01394ba1972bded363130d1b033ab9336ffda9f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-09-03  Bruno Haible  <bruno@clisp.org>
+
+       net_if: Add C++ tests.
+       * tests/test-net_if-c++.cc: New file.
+       * modules/net_if-c++-tests: New file.
+       * modules/net_if-tests (Depends-on): Add net_if-c++-tests.
+       * doc/posix-headers/net_if.texi: Fix documentation.
+
 2022-09-03  Bruno Haible  <bruno@clisp.org>
 
        termcap: Fix link error on AIX 7.
index 48ffa502aec88fb9d979ac03c088c8da2547f049..7d967a815cc76fd8e0b602bd2004f37f67728ca4 100644 (file)
@@ -8,6 +8,9 @@ Gnulib module: net_if
 Portability problems fixed by Gnulib:
 @itemize
 @item
+This header file is missing on some platforms:
+mingw, MSVC 14.
+@item
 This header file is not self-contained on some platforms (needing
 <sys/socket.h> to be included first):
 Mac OS X 10.5, FreeBSD 8.2, OpenBSD 5.2.
@@ -15,7 +18,4 @@ Mac OS X 10.5, FreeBSD 8.2, OpenBSD 5.2.
 
 Portability problems not fixed by Gnulib:
 @itemize
-@item
-This header file is missing on some platforms:
-mingw, MSVC 14.
 @end itemize
diff --git a/modules/net_if-c++-tests b/modules/net_if-c++-tests
new file mode 100644 (file)
index 0000000..2111696
--- /dev/null
@@ -0,0 +1,19 @@
+Files:
+tests/test-net_if-c++.cc
+
+Status:
+c++-test
+
+Depends-on:
+ansi-c++-opt
+net_if-tests
+
+configure.ac:
+
+Makefile.am:
+if ANSICXX
+TESTS += test-net_if-c++
+check_PROGRAMS += test-net_if-c++
+test_net_if_c___SOURCES = test-net_if-c++.cc
+test_net_if_c___LDADD = $(LDADD) @NET_IF_LIB@
+endif
index 131880383ea8e0e581a1052bf50add171016323a..116bf62ea6a73d71bda2c574eca7175473597fdb 100644 (file)
@@ -3,6 +3,7 @@ tests/test-net_if.c
 tests/signature.h
 
 Depends-on:
+net_if-c++-tests
 
 configure.ac:
 NET_IF_LIB=
diff --git a/tests/test-net_if-c++.cc b/tests/test-net_if-c++.cc
new file mode 100644 (file)
index 0000000..b78d00b
--- /dev/null
@@ -0,0 +1,28 @@
+/* Test of <net/if.h> substitute in C++ mode.
+   Copyright (C) 2022 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>, 2022.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <net/if.h>
+
+
+int
+main ()
+{
+}