Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57735 - trunk/libs/format/test
From: Samuel.Krempp_at_[hidden]
Date: 2009-11-17 17:51:17


Author: samuel_krempp
Date: 2009-11-17 17:51:17 EST (Tue, 17 Nov 2009)
New Revision: 57735
URL: http://svn.boost.org/trac/boost/changeset/57735

Log:
adds tests for new member functions expected_args remaining_args fed_args bound_args and cur_arg .
Text files modified:
   trunk/libs/format/test/format_test3.cpp | 10 ++++++++++
   1 files changed, 10 insertions(+), 0 deletions(-)

Modified: trunk/libs/format/test/format_test3.cpp
==============================================================================
--- trunk/libs/format/test/format_test3.cpp (original)
+++ trunk/libs/format/test/format_test3.cpp 2009-11-17 17:51:17 EST (Tue, 17 Nov 2009)
@@ -93,6 +93,16 @@
       BOOST_ERROR("nesting did not work");
     }
 
+ // bind args, and various arguments counts :
+ boost::format bf("%1% %4% %1%");
+ bf.bind_arg(1, "one") % 2 % "three" ;
+ BOOST_CHECK_EQUAL(bf.expected_args(), 4);
+ BOOST_CHECK_EQUAL(bf.fed_args(), 2);
+ BOOST_CHECK_EQUAL(bf.bound_args(), 1);
+ BOOST_CHECK_EQUAL(bf.remaining_args(), 1);
+ BOOST_CHECK_EQUAL(bf.cur_arg(), 4);
+
+
     // testcase for bug reported at
     // http://lists.boost.org/boost-users/2006/05/19723.php
     format f("%40t%1%");


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