|
Boost-Commit : |
From: chintanraoh_at_[hidden]
Date: 2008-06-18 14:13:53
Author: chintanraoh
Date: 2008-06-18 14:13:53 EDT (Wed, 18 Jun 2008)
New Revision: 46485
URL: http://svn.boost.org/trac/boost/changeset/46485
Log:
test for copy
Text files modified:
sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/test/test_pat_trie.cpp | 45 ++++++++++++++++++++++++++++++---------
1 files changed, 34 insertions(+), 11 deletions(-)
Modified: sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/test/test_pat_trie.cpp
==============================================================================
--- sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/test/test_pat_trie.cpp (original)
+++ sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/test/test_pat_trie.cpp 2008-06-18 14:13:53 EDT (Wed, 18 Jun 2008)
@@ -11,33 +11,34 @@
void insert_test_1()
{
T pat;
- BOOST_CHECK ( pat.find("") == 0 ) ;
+ //BOOST_CHECK ( pat.find("") == 0 ) ;
- pat.insert( std::make_pair("",1) );
+ pat.insert ( std::make_pair("",1) );
BOOST_CHECK ( pat.find("") );
- pat.insert( std::make_pair("raining",1) );
+ pat.insert ( std::make_pair("raining",1) );
BOOST_CHECK ( pat.find("raining") );
- BOOST_CHECK ( pat.find("weather") == 0 );
- BOOST_CHECK ( pat.find("rain") == 0 );
+ //BOOST_CHECK ( pat.find("weather") == 0 );
+ //BOOST_CHECK ( pat.find("rain") == 0 );
- pat.insert( std::make_pair("rain",1) );
+ pat.insert ( std::make_pair("rain",1) );
BOOST_CHECK ( pat.find("rain") );
+ BOOST_CHECK ( pat.find("") );
- pat.insert( std::make_pair("raina",1) );
+ pat.insert ( std::make_pair("raina",1) );
BOOST_CHECK ( pat.find("raina") );
BOOST_CHECK ( pat.find("rain") );
- pat.insert( std::make_pair("weather",1) );
+ pat.insert ( std::make_pair("weather",1) );
BOOST_CHECK ( pat.find("weather") );
BOOST_CHECK ( pat.find("rain") );
BOOST_CHECK ( pat.find("raining") );
- pat.insert( std::make_pair("weat",1) );
+ pat.insert ( std::make_pair("weat",1) );
BOOST_CHECK ( pat.find("weat") );
- pat.insert( std::make_pair("weating",1) );
+ pat.insert ( std::make_pair("weating",1) );
BOOST_CHECK ( pat.find("weating") );
@@ -46,6 +47,18 @@
BOOST_CHECK ( pat.find("raining") );
BOOST_CHECK ( pat.find("raina") );
BOOST_CHECK ( pat.find("weat") );
+ BOOST_CHECK ( pat.find("") );
+
+ T pat1(pat);
+ std::cout<<"PAT 1"<<std::endl;
+ typename T::iterator it;
+ int i=0;
+ for(it=pat1.begin();it!=pat1.end();it++)
+ {
+ i++;
+ std::cout<<(*it).first<<std::endl;
+ }
+ std::cout<<"END PAT 1"<<std::endl;
}
template<class T>
@@ -259,7 +272,6 @@
T pat;
std::cout<<"here"<<std::endl;
assert(pat.begin()==pat.end());
-
return;
}
@@ -306,13 +318,24 @@
#endif
}
+template<class T>
+void copy_test()
+{
+ T pat1;
+ pat1["hello"]=1;
+ pat1["hell"]=1;
+ T pat2=T(pat1);
+}
+
int test_main(int argc,char **argv)
{
typedef patricia< std::string, int, pat_key_traits> pat_type;
+
#ifndef NOTEST
insert_test_1<pat_type>();
insert_test_2<pat_type>();
erase_test<pat_type>();
+ copy_test<pat_type>();
#endif
if ( argc > 1 )
insert_test_3<pat_type>(argv[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