|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r56916 - in branches/release/libs/spirit/test: . karma qi
From: hartmut.kaiser_at_[hidden]
Date: 2009-10-16 09:06:18
Author: hkaiser
Date: 2009-10-16 09:06:17 EDT (Fri, 16 Oct 2009)
New Revision: 56916
URL: http://svn.boost.org/trac/boost/changeset/56916
Log:
Spirit: merging from trunk (added test detecting endianess/truncation problem on little endian systems)
Properties modified:
branches/release/libs/spirit/test/ (props changed)
branches/release/libs/spirit/test/qi/optional.cpp (props changed)
Text files modified:
branches/release/libs/spirit/test/karma/alternative.cpp | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
Modified: branches/release/libs/spirit/test/karma/alternative.cpp
==============================================================================
--- branches/release/libs/spirit/test/karma/alternative.cpp (original)
+++ branches/release/libs/spirit/test/karma/alternative.cpp 2009-10-16 09:06:17 EDT (Fri, 16 Oct 2009)
@@ -48,6 +48,17 @@
BOOST_TEST(test("c", int_ | char_ | lit('a'), v));
}
+ // testing for alignment/truncation problems on little endian systems
+ // (big endian systems will fail one of the other tests below)
+ {
+ std::basic_string<wchar_t> generated;
+ std::back_insert_iterator<std::basic_string<wchar_t> > outit(generated);
+ boost::variant<int, char> v(10);
+ bool result = karma::generate_delimited(outit
+ , karma::int_ | karma::char_, karma::char_(' '), v);
+ BOOST_TEST(result && generated == L"10 ");
+ }
+
{
// test if alternatives with all components having unused
// attribute generate first alternative
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