Boost logo

Boost-Commit :

From: chintanraoh_at_[hidden]
Date: 2008-06-02 15:24:01


Author: chintanraoh
Date: 2008-06-02 15:24:01 EDT (Mon, 02 Jun 2008)
New Revision: 46054
URL: http://svn.boost.org/trac/boost/changeset/46054

Log:
changed test for bool find() to iterator find()
Text files modified:
   sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/test/test.cpp | 22 +++++++++++++++-------
   1 files changed, 15 insertions(+), 7 deletions(-)

Modified: sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/test/test.cpp
==============================================================================
--- sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/test/test.cpp (original)
+++ sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/test/test.cpp 2008-06-02 15:24:01 EDT (Mon, 02 Jun 2008)
@@ -15,19 +15,22 @@
         T tr;
         typename T::cursor c;
         typename T::iterator tr_it;
+ typedef typename T::const_iterator const_iterator;
+ const_iterator tr_const_it;
+
         std::string str="hello";
         tr.insert( std::make_pair(str,1) );
         tr.insert( std::make_pair("he",2) );
 
- assert( tr["hello"]==1 );
- assert( !tr.find("hell") );
- assert( !tr.find("helli") );
- assert(tr.find("he"));
+ assert( tr["hello"] == 1 );
+ assert( tr.find("hell") == tr.end() );
+ assert( tr.find("helli") == tr.end() );
+ assert(tr.find("he") != tr.end() );
         tr.erase("he");
- assert( !tr.find("he") );
- assert( tr.find("hello") );
+ assert( tr.find("he") == tr.end() );
+ assert( tr.find("hello") != tr.end() );
         tr.erase("hello");
- assert( !tr.find("hello") );
+ assert( tr.find("hello") == tr.end() );
         c=tr.root();
         tr.insert( std::make_pair("he",2) );
         tr.insert( std::make_pair("hello",3) );
@@ -40,6 +43,8 @@
         c=tr.root().begin();
         c++;
 
+
+
         tr.begin();
         tr.clear();
         std::cout<<"GRR...AT THE END"<<std::endl;
@@ -73,6 +78,9 @@
         assert(*tr_it==10);
 
         assert(tr_it==tr_it);
+
+ //tr_const_it=const_iterator(tr.begin());
+ //tr_const_it++;
         
         tr.clear();
         //assert(c->find('h')!=c.begin()->end());


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