Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49233 - trunk/libs/spirit/classic/test
From: daniel_james_at_[hidden]
Date: 2008-10-09 18:16:11


Author: danieljames
Date: 2008-10-09 18:16:11 EDT (Thu, 09 Oct 2008)
New Revision: 49233
URL: http://svn.boost.org/trac/boost/changeset/49233

Log:
Add some extra checks to position_iterator tests, and fix an incorrect character count.
Text files modified:
   trunk/libs/spirit/classic/test/position_iterator_tests.cpp | 12 ++++++++----
   1 files changed, 8 insertions(+), 4 deletions(-)

Modified: trunk/libs/spirit/classic/test/position_iterator_tests.cpp
==============================================================================
--- trunk/libs/spirit/classic/test/position_iterator_tests.cpp (original)
+++ trunk/libs/spirit/classic/test/position_iterator_tests.cpp 2008-10-09 18:16:11 EDT (Thu, 09 Oct 2008)
@@ -150,6 +150,7 @@
     ++iter; // 3
     ++iter; // newline
     BOOST_TEST(*iter == '\n' || *iter == '\r');
+ BOOST_TEST(iter.get_position().line == 2);
     ++iter; // 4
     BOOST_TEST(iter.get_position().line == 3);
     ++iter; // 5
@@ -157,12 +158,15 @@
     ++iter; // 7
     ++iter; // newline
     BOOST_TEST(*iter == '\n' || *iter == '\r');
+ BOOST_TEST(iter.get_position().line == 3);
     ++iter; // 8
     BOOST_TEST(iter.get_position().line == 4);
     ++iter; // 9
     ++iter; // newline
+ BOOST_TEST(iter.get_position().line == 4);
     BOOST_TEST(*iter == '\n' || *iter == '\r');
     ++iter; // end
+ BOOST_TEST(iter.get_position().line == 5);
     BOOST_TEST(iter == end);
 }
 
@@ -427,10 +431,10 @@
 
     const char* b = "\n0123\r\n4567\n89\n\r";
 
- test_impl::CheckLineCounting(position_iterator<iter_t>(b, b+15, ""));
- test_impl::CheckLineCounting(position_iterator2<iter_t>(b, b+15, ""));
- test_impl::CheckLineCounting(position_iterator<iter_t, file_position_without_column>(b, b+15, ""));
- test_impl::CheckLineCounting(position_iterator2<iter_t, file_position_without_column>(b, b+15, ""));
+ test_impl::CheckLineCounting(position_iterator<iter_t>(b, b+16, ""));
+ test_impl::CheckLineCounting(position_iterator2<iter_t>(b, b+16, ""));
+ test_impl::CheckLineCounting(position_iterator<iter_t, file_position_without_column>(b, b+16, ""));
+ test_impl::CheckLineCounting(position_iterator2<iter_t, file_position_without_column>(b, b+16, ""));
 }
 
 


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