Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54391 - trunk/libs/spirit/test/qi
From: joel_at_[hidden]
Date: 2009-06-27 00:30:42


Author: djowel
Date: 2009-06-27 00:30:40 EDT (Sat, 27 Jun 2009)
New Revision: 54391
URL: http://svn.boost.org/trac/boost/changeset/54391

Log:
added overflow check
Text files modified:
   trunk/libs/spirit/test/qi/uint.cpp | 10 ++++++++++
   1 files changed, 10 insertions(+), 0 deletions(-)

Modified: trunk/libs/spirit/test/qi/uint.cpp
==============================================================================
--- trunk/libs/spirit/test/qi/uint.cpp (original)
+++ trunk/libs/spirit/test/qi/uint.cpp 2009-06-27 00:30:40 EDT (Sat, 27 Jun 2009)
@@ -183,6 +183,16 @@
         BOOST_TEST(test(" 456", uint_[ref(n) = _1], space));
         BOOST_TEST(n == 456);
     }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Check overflow is parse error
+ ///////////////////////////////////////////////////////////////////////////
+ {
+ using boost::spirit::qi::uint_;
+ boost::uint8_t u;
+
+ BOOST_TEST(!test_attr("999", uint_, u));
+ }
 
     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