Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67142 - trunk/libs/wave/test/testwave
From: hartmut.kaiser_at_[hidden]
Date: 2010-12-09 21:51:04


Author: hkaiser
Date: 2010-12-09 21:50:59 EST (Thu, 09 Dec 2010)
New Revision: 67142
URL: http://svn.boost.org/trac/boost/changeset/67142

Log:
Wave: fixing some path formatting issues causing test to fail
Text files modified:
   trunk/libs/wave/test/testwave/collect_hooks_information.hpp | 11 ++++++-----
   trunk/libs/wave/test/testwave/testwave_app.cpp | 10 +++++++++-
   2 files changed, 15 insertions(+), 6 deletions(-)

Modified: trunk/libs/wave/test/testwave/collect_hooks_information.hpp
==============================================================================
--- trunk/libs/wave/test/testwave/collect_hooks_information.hpp (original)
+++ trunk/libs/wave/test/testwave/collect_hooks_information.hpp 2010-12-09 21:50:59 EST (Thu, 09 Dec 2010)
@@ -85,12 +85,13 @@
 
 #if defined(BOOST_WINDOWS)
 template <typename String>
-inline String replace_slashes(String value)
+inline String replace_slashes(String value, char const* lookfor = "\\",
+ char replace_with = '/')
 {
- typename String::size_type p = value.find_first_of("\\");
+ typename String::size_type p = value.find_first_of(lookfor);
     while (p != value.npos) {
- value[p] = '/';
- p = value.find_first_of("\\", p+1);
+ value[p] = replace_with;
+ p = value.find_first_of(lookfor, p+1);
     }
     return value;
 }
@@ -279,7 +280,7 @@
     ///////////////////////////////////////////////////////////////////////////
     template <typename Context>
     bool
- found_include_directive(Context const& ctx, std::string const& filename,
+ found_include_directive(Context const& ctx, std::string filename,
         bool include_next)
     {
         BOOST_WAVETEST_OSSTREAM strm;

Modified: trunk/libs/wave/test/testwave/testwave_app.cpp
==============================================================================
--- trunk/libs/wave/test/testwave/testwave_app.cpp (original)
+++ trunk/libs/wave/test/testwave/testwave_app.cpp 2010-12-09 21:50:59 EST (Thu, 09 Dec 2010)
@@ -211,9 +211,17 @@
                             boost::wave::util::create_path(base);
                         full_result += expected.substr(pos, pos1-pos);
                         if ('P' == expected[pos1+1]) {
- full_result += escape_lit(
+#if defined(BOOST_WINDOWS)
+ std::string p = replace_slashes(
+ boost::wave::util::native_file_string(
+ boost::wave::util::normalize(fullpath)),
+ "/", '\\');
+#else
+ std::string p (
                                 boost::wave::util::native_file_string(
                                     boost::wave::util::normalize(fullpath)));
+#endif
+ full_result += escape_lit(p);
                         }
                         else {
 #if defined(BOOST_WINDOWS)


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