From 8828d82d4db1467a7c9e35874259be495b8da18d Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Sun, 27 Nov 2011 16:19:55 +0000 Subject: [PATCH] char16_t and char32_t tests: removed dependencies on Unicode literals, add test for implementations that are typedefs and so not really conforming. Unicode literal test: now check for all three forms of Unicode literals - u8, u, and U. [SVN r75694] --- test/all/Jamfile.v2 | 2 +- test/boost_no_char16_t.ipp | 13 ++++++++++--- test/boost_no_char32_t.ipp | 13 ++++++++++--- test/boost_no_unicode_literals.ipp | 2 ++ test/config_info.cpp | 4 ++++ test/config_test.cpp | 2 +- 6 files changed, 28 insertions(+), 8 deletions(-) diff --git a/test/all/Jamfile.v2 b/test/all/Jamfile.v2 index 2c10d7f3..811c052a 100644 --- a/test/all/Jamfile.v2 +++ b/test/all/Jamfile.v2 @@ -1,7 +1,7 @@ # # Regression test Jamfile for boost configuration setup. # *** DO NOT EDIT THIS FILE BY HAND *** -# This file was automatically generated on Wed Jul 13 18:50:14 2011 +# This file was automatically generated on Sun Nov 27 09:43:19 2011 # by libs/config/tools/generate.cpp # Copyright John Maddock. # Use, modification and distribution are subject to the diff --git a/test/boost_no_char16_t.ipp b/test/boost_no_char16_t.ipp index c2f0f59b..27d49c62 100644 --- a/test/boost_no_char16_t.ipp +++ b/test/boost_no_char16_t.ipp @@ -13,12 +13,19 @@ namespace boost_no_char16_t { -void quiet_warning(const char16_t*){} +// Microsoft VC++ 2010, and possibly other compilers, provides +// a typedef for char16_t rather than a new type. We want that +// to be an error, so provide an overloaded function that will +// be ambiguous if char16_t is just a typedef. +void f(const char16_t*){} +void f(const unsigned short*){} +void f(const unsigned int*){} +void f(const unsigned long*){} int test() { - const char16_t* p = u"abc"; - quiet_warning(p); + const char16_t* p; + f(p); return 0; } diff --git a/test/boost_no_char32_t.ipp b/test/boost_no_char32_t.ipp index e03b1567..5dfcd15d 100644 --- a/test/boost_no_char32_t.ipp +++ b/test/boost_no_char32_t.ipp @@ -12,12 +12,19 @@ namespace boost_no_char32_t { -void quiet_warning(const char32_t*){} +// Microsoft VC++ 2010, and possibly other compilers, provides +// a typedef for char32_t rather than a new type. We want that +// to be an error, so provide an overloaded function that will +// be ambiguous if char16_t is just a typedef. +void f(const char32_t*){} +void f(const unsigned short*){} +void f(const unsigned int*){} +void f(const unsigned long*){} int test() { - const char32_t* p = U"abc"; - quiet_warning(p); + const char32_t* p; + f(p); return 0; } diff --git a/test/boost_no_unicode_literals.ipp b/test/boost_no_unicode_literals.ipp index c3be0a19..ec8963ba 100644 --- a/test/boost_no_unicode_literals.ipp +++ b/test/boost_no_unicode_literals.ipp @@ -17,6 +17,8 @@ void quiet_warning(const char*){} int test() { const char* c8 = u8""; + const char16_t* c16 = u""; + const char32_t* c32 = U""; quiet_warning(c8); return 0; } diff --git a/test/config_info.cpp b/test/config_info.cpp index 3877f001..ae9578df 100644 --- a/test/config_info.cpp +++ b/test/config_info.cpp @@ -1102,6 +1102,10 @@ void print_boost_macros() + + + + // END GENERATED BLOCK PRINT_MACRO(BOOST_INTEL); diff --git a/test/config_test.cpp b/test/config_test.cpp index 8e909be7..3f8cb588 100644 --- a/test/config_test.cpp +++ b/test/config_test.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Wed Jul 13 18:50:14 2011 +// This file was automatically generated on Sun Nov 27 09:43:19 2011 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the