Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63127 - trunk/libs/spirit/test/qi
From: joel_at_[hidden]
Date: 2010-06-20 06:05:11


Author: djowel
Date: 2010-06-20 06:05:10 EDT (Sun, 20 Jun 2010)
New Revision: 63127
URL: http://svn.boost.org/trac/boost/changeset/63127

Log:
disallowing partial parses of ints and enforcing overflow-is-parse-error rule.
Text files modified:
   trunk/libs/spirit/test/qi/int.cpp | 8 ++++++--
   trunk/libs/spirit/test/qi/symbols.cpp | 14 ++++++++++++++
   2 files changed, 20 insertions(+), 2 deletions(-)

Modified: trunk/libs/spirit/test/qi/int.cpp
==============================================================================
--- trunk/libs/spirit/test/qi/int.cpp (original)
+++ trunk/libs/spirit/test/qi/int.cpp 2010-06-20 06:05:10 EDT (Sun, 20 Jun 2010)
@@ -116,8 +116,7 @@
         BOOST_TEST(!test_attr("+", int_, i));
 
         // Bug report from Steve Nutt
- BOOST_TEST(test_attr("5368709120", int_, i, false));
- BOOST_TEST(i == 536870912);
+ BOOST_TEST(!test_attr("5368709120", int_, i));
 
         // with leading zeros
         BOOST_TEST(test("0000000000123456", int_));
@@ -181,6 +180,11 @@
         char c;
 
         BOOST_TEST(!test_attr("999", int8_, c));
+
+ int i;
+ using boost::spirit::short_;
+ BOOST_TEST(!test_attr("32769", short_, i, false));
+ BOOST_TEST(!test_attr("41234", short_, i, false));
     }
 
     ///////////////////////////////////////////////////////////////////////////

Modified: trunk/libs/spirit/test/qi/symbols.cpp
==============================================================================
--- trunk/libs/spirit/test/qi/symbols.cpp (original)
+++ trunk/libs/spirit/test/qi/symbols.cpp 2010-06-20 06:05:10 EDT (Sun, 20 Jun 2010)
@@ -345,6 +345,20 @@
         first = str; last = str + 2;
         BOOST_TEST(!sym.prefix_find(first, last) && first == str);
     }
+
+ {
+ // remove bug
+
+ std::string s;
+ symbols<char, double> vars;
+
+ vars.add("l1", 12.0);
+ vars.add("l2", 0.0);
+ vars.remove("l2");
+ vars.find("l1");
+ double* d = vars.find("l1");
+ BOOST_TEST(d != 0);
+ }
 
     return boost::report_errors();
 }


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