|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r77433 - trunk/libs/spirit/test/support
From: joel_at_[hidden]
Date: 2012-03-20 11:14:13
Author: djowel
Date: 2012-03-20 11:14:10 EDT (Tue, 20 Mar 2012)
New Revision: 77433
URL: http://svn.boost.org/trac/boost/changeset/77433
Log:
test for ticket #6714 (fixed)
Text files modified:
trunk/libs/spirit/test/support/utree.cpp | 29 +++++++++++++++++++++--------
1 files changed, 21 insertions(+), 8 deletions(-)
Modified: trunk/libs/spirit/test/support/utree.cpp
==============================================================================
--- trunk/libs/spirit/test/support/utree.cpp (original)
+++ trunk/libs/spirit/test/support/utree.cpp 2012-03-20 11:14:10 EDT (Tue, 20 Mar 2012)
@@ -25,7 +25,7 @@
if (s.str() == expected + " ")
return true;
- std::cerr << "got result: " << s.str()
+ std::cerr << "got result: " << s.str()
<< ", expected: " << expected << std::endl;
return false;
}
@@ -88,8 +88,8 @@
// single element string
utree val('x');
BOOST_TEST(check(val, "\"x\""));
-
- // empty string
+
+ // empty string
utree val1("");
BOOST_TEST(check(val1, "\"\""));
}
@@ -195,6 +195,19 @@
val.insert(val.begin(), val2.begin(), val2.end());
BOOST_TEST(check(val, "( 123.456 \"Mah Doggie\" \"Chuckie\" ( 123.456 \"Mah Doggie\" ) )"));
BOOST_TEST_EQ(val.size(), 4U);
+
+ // Regeression Ticket #6714
+ it = val.insert(val.end(), 111);
+ BOOST_TEST(it != val.begin());
+ BOOST_TEST(it == --val.end());
+ BOOST_TEST(*it == 111);
+
+ val.clear();
+ it = val.insert(val.begin(), 222);
+ BOOST_TEST(it == val.begin());
+ BOOST_TEST(it == --val.end());
+ BOOST_TEST(*it == 222);
+ // Regeression Ticket #6714
}
{
@@ -319,17 +332,17 @@
BOOST_TEST((utree(false) && utree(true)) == utree(false));
BOOST_TEST((utree(true) && utree(false)) == utree(false));
BOOST_TEST((utree(true) && utree(true)) == utree(true));
-
+
BOOST_TEST((utree(0) && utree(0)) == utree(false));
BOOST_TEST((utree(0) && utree(1)) == utree(false));
BOOST_TEST((utree(1) && utree(0)) == utree(false));
BOOST_TEST((utree(1) && utree(1)) == utree(true));
-
+
BOOST_TEST((utree(false) || utree(false)) == utree(false));
BOOST_TEST((utree(false) || utree(true)) == utree(true));
BOOST_TEST((utree(true) || utree(false)) == utree(true));
BOOST_TEST((utree(true) || utree(true)) == utree(true));
-
+
BOOST_TEST((utree(0) || utree(0)) == utree(false));
BOOST_TEST((utree(0) || utree(1)) == utree(true));
BOOST_TEST((utree(1) || utree(0)) == utree(true));
@@ -380,7 +393,7 @@
{
// check the tag
- // TODO: test tags on all utree types
+ // TODO: test tags on all utree types
utree x;
x.tag(123);
BOOST_TEST_EQ(x.tag(), 123);
@@ -411,7 +424,7 @@
utree f = stored_function<one_two_three>();
f.eval(utree());
}
-
+
{
// test referenced functions
using boost::spirit::referenced_function;
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