]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
wchar: Add more C++ tests.
authorBruno Haible <bruno@clisp.org>
Thu, 5 Dec 2019 08:18:13 +0000 (09:18 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 5 Dec 2019 08:50:50 +0000 (09:50 +0100)
Reported by Christian Biesinger <cbiesinger@google.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2019-12/msg00009.html>.

* tests/test-wchar-c++3.cc: New file.
* modules/wchar-c++-tests (Files): Add it.
(Makefile.am): Compile it.

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

index bbc40dd964bd6342a90ee556233ffd1d364a55aa..8574070f1fb0f2a292e721886ab999d931e434e6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2019-12-05  Bruno Haible  <bruno@clisp.org>
+
+       wchar: Add more C++ tests.
+       Reported by Christian Biesinger <cbiesinger@google.com> in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2019-12/msg00009.html>.
+       * tests/test-wchar-c++3.cc: New file.
+       * modules/wchar-c++-tests (Files): Add it.
+       (Makefile.am): Compile it.
+
 2019-12-05  Bruno Haible  <bruno@clisp.org>
 
        Add more C++ tests.
index 75ff6518a942ed1df009f397fe4a6efc1ea41105..a91e43aec468bfcf5225144e0dadb4172f4fddb0 100644 (file)
@@ -1,6 +1,7 @@
 Files:
 tests/test-wchar-c++.cc
 tests/test-wchar-c++2.cc
+tests/test-wchar-c++3.cc
 tests/signature.h
 
 Status:
@@ -15,6 +16,6 @@ Makefile.am:
 if ANSICXX
 TESTS += test-wchar-c++
 check_PROGRAMS += test-wchar-c++
-test_wchar_c___SOURCES = test-wchar-c++.cc test-wchar-c++2.cc
+test_wchar_c___SOURCES = test-wchar-c++.cc test-wchar-c++2.cc test-wchar-c++3.cc
 test_wchar_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_EACCESS) $(LIBTHREAD)
 endif
diff --git a/tests/test-wchar-c++3.cc b/tests/test-wchar-c++3.cc
new file mode 100644 (file)
index 0000000..622dec0
--- /dev/null
@@ -0,0 +1,22 @@
+/* Test of <wchar.h> substitute in C++ mode.
+   Copyright (C) 2019 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/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <wchar.h>
+#include <cstring>
+#include <sstream>