Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63296 - trunk/libs/filesystem/v3/test
From: bdawes_at_[hidden]
Date: 2010-06-24 16:16:32


Author: bemandawes
Date: 2010-06-24 16:16:30 EDT (Thu, 24 Jun 2010)
New Revision: 63296
URL: http://svn.boost.org/trac/boost/changeset/63296

Log:
fix path_unit_test wrong assumption about what characters system's default locale codecvt facet can accept
Text files modified:
   trunk/libs/filesystem/v3/test/path_unit_test.cpp | 29 +++++++----------------------
   1 files changed, 7 insertions(+), 22 deletions(-)

Modified: trunk/libs/filesystem/v3/test/path_unit_test.cpp
==============================================================================
--- trunk/libs/filesystem/v3/test/path_unit_test.cpp (original)
+++ trunk/libs/filesystem/v3/test/path_unit_test.cpp 2010-06-24 16:16:30 EDT (Thu, 24 Jun 2010)
@@ -597,30 +597,19 @@
   {
     std::cout << "testing imbue locale..." << std::endl;
 
- // \u2722 and \xE2\x9C\xA2 are UTF-16 and UTF-8 FOUR TEARDROP-SPOKED ASTERISK
+ // weak test case for before/after states since we don't know what characters the
+ // default locale accepts.
+ path before("abc");
 
- std::cout << " testing p0 ..." << std::endl;
- path p0(L"\u2722"); // for tests that depend on path_traits::convert
-# ifdef BOOST_WINDOWS_API
- CHECK(p0.string() != "\xE2\x9C\xA2");
-# endif
- string p0_string(p0.string());
-
- std::cout << " testing p1 ..." << std::endl;
- path p1("\xE2\x9C\xA2");
-# ifdef BOOST_WINDOWS_API
- CHECK(p1 != L"\u2722");
-# endif
- wstring p1_wstring(p1.wstring());
+ // So that tests are run with known encoding, use Boost UTF-8 codecvt
+ // \u2722 and \xE2\x9C\xA2 are UTF-16 and UTF-8 FOUR TEARDROP-SPOKED ASTERISK
 
- // So that tests are run with known encoding, use Boost UTF-8 codecvt
     std::locale global_loc = std::locale();
     std::locale loc(global_loc, new fs::detail::utf8_codecvt_facet);
     std::cout << " imbuing locale ..." << std::endl;
     std::locale old_loc = path::imbue(loc);
 
     std::cout << " testing with the imbued locale ..." << std::endl;
- CHECK(p0.string() == "\xE2\x9C\xA2");
     path p2("\xE2\x9C\xA2");
     CHECK(p2 == L"\u2722");
     CHECK(p2.wstring() == L"\u2722");
@@ -629,12 +618,8 @@
     path::imbue(old_loc);
 
     std::cout << " testing with the original locale ..." << std::endl;
- CHECK(p0.string() == p0_string);
- path p3("\xE2\x9C\xA2");
-# ifdef BOOST_WINDOWS_API
- CHECK(p3 != L"\u2722");
-# endif
- CHECK(p3.wstring() == p1_wstring);
+ path after("abc");
+ CHECK(before == after);
 
     std::cout << " locale testing complete" << std::endl;
   }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk