Boost logo

Boost-Commit :

From: chintanraoh_at_[hidden]
Date: 2008-08-28 23:06:11


Author: chintanraoh
Date: 2008-08-28 23:06:10 EDT (Thu, 28 Aug 2008)
New Revision: 48437
URL: http://svn.boost.org/trac/boost/changeset/48437

Log:
removed pat_key_traits header
Text files modified:
   sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/test/test_pat_custom_class.cpp | 63 +++++++++++++++++++++++++++++----------
   sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/test/test_pat_other.cpp | 2
   sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/test/test_pat_trie.cpp | 2
   3 files changed, 48 insertions(+), 19 deletions(-)

Modified: sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/test/test_pat_custom_class.cpp
==============================================================================
--- sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/test/test_pat_custom_class.cpp (original)
+++ sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/test/test_pat_custom_class.cpp 2008-08-28 23:06:10 EDT (Thu, 28 Aug 2008)
@@ -1,7 +1,7 @@
 #include<list>
 #include<vector>
 #include<boost/dsearch/patricia.hpp>
-#include<boost/dsearch/pat_key_traits.hpp>
+//#include<boost/dsearch/pat_key_traits.hpp>
 #include<boost/test/minimal.hpp>
 
 using namespace boost::minimal_test;
@@ -10,22 +10,33 @@
 template<class T>
 class custom_class {
         public:
+ typedef custom_class<T> self;
         typedef T container_type;
         typedef typename container_type::iterator iterator ;
         typedef typename container_type::const_iterator const_iterator ;
         container_type con;
         
- explicit custom_class(container_type ll )
+ explicit custom_class ( container_type ll )
         {
                 con=ll;
         }
+
+ custom_class ( const self &other )
+ {
+ (*this)=other;
+ }
+
+ custom_class ()
+ {
+ // std::cout<<"default"<<std::endl;
+ }
 
- const_iterator begin() const
+ const_iterator begin () const
         {
- return con.begin();
+ return con.begin ();
         }
         
- const_iterator end() const
+ const_iterator end () const
         {
                 return con.end();
         }
@@ -34,6 +45,13 @@
         {
                 return con.size();
         }
+
+ self &operator = (const self & other)
+ {
+ con=other.con;
+ std::cout<<"Equating"<<std::endl;
+ return *this;
+ }
 
 };
 
@@ -66,30 +84,38 @@
 };
 
 template<class T>
-void container_test()
+void container_test ( )
 {
         typedef custom_class< T > cc;
         typedef patricia<cc, float, custom_class_traits<cc> > pat_type;
+ typedef std::pair<typename pat_type::iterator,typename pat_type::iterator> range_type;
+ range_type prefix_pair;
+ cc a,b;
+ b=a;
 
         T ll;
         pat_type pat_trie;
 
- ll.push_back(0);
- ll.push_back(1);
+ ll.push_back ( 0 ) ;
+ ll.push_back ( 1 ) ;
         
- pat_trie[ cc(ll) ]=2;
- pat_trie.erase( cc(ll) );
+ pat_trie[ cc(ll) ]=2 ;
+ pat_trie.erase( cc(ll) ) ;
         
- pat_trie.prefix_range( cc(ll) );
         pat_trie.find ( cc(ll) );
- pat_trie.lower_bound ( cc(ll) );
- pat_trie.upper_bound ( cc(ll) );
- std::distance ( pat_trie.begin(), pat_trie.end() );
- BOOST_REQUIRE ( pat_trie.rbegin() == pat_trie.rend() );
- std::distance ( pat_trie.rbegin(), pat_trie.rend() );
+ pat_trie.lower_bound ( cc(ll) ) ;
+ pat_trie.upper_bound ( cc(ll) ) ;
+
+ std::distance ( pat_trie.begin(), pat_trie.end() ) ;
+ BOOST_CHECK ( pat_trie.rbegin() == pat_trie.rend() ) ;
+ BOOST_CHECK ( std::distance ( pat_trie.rbegin(), pat_trie.rend() )
+ == static_cast<typename pat_type::difference_type>(pat_trie.size() ) ) ;
+ prefix_pair=pat_trie.prefix_range ( cc(ll) ) ;
+ BOOST_CHECK ( prefix_pair.first == prefix_pair.second );
+ BOOST_CHECK ( prefix_pair.first == pat_trie.end() );
 }
 
-int test_main(int, char**)
+int test_main ( int, char** )
 {
         std::cout<<"container_test<std::list<int> >();"<<std::endl;
         container_test<std::list<int> >();
@@ -100,5 +126,8 @@
         std::cout<<"container_test<std::vector<unsigned char> >();"<<std::endl;
         container_test<std::vector<unsigned char> >();
         
+ std::cout<<"container_test<std::wstring >();"<<std::endl;
+ container_test<std::wstring >();
+
         return 0;
 }

Modified: sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/test/test_pat_other.cpp
==============================================================================
--- sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/test/test_pat_other.cpp (original)
+++ sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/test/test_pat_other.cpp 2008-08-28 23:06:10 EDT (Thu, 28 Aug 2008)
@@ -1,5 +1,5 @@
 #include<boost/dsearch/patricia.hpp>
-#include<boost/dsearch/pat_key_traits.hpp>
+//#include<boost/dsearch/pat_key_traits.hpp>
 #include<boost/test/minimal.hpp>
 #include<vector>
 #include<string>

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-08-28 23:06:10 EDT (Thu, 28 Aug 2008)
@@ -1,5 +1,5 @@
 #include<boost/dsearch/patricia.hpp>
-#include<boost/dsearch/pat_key_traits.hpp>
+//#include<boost/dsearch/pat_key_traits.hpp>
 #include<boost/test/minimal.hpp>
 #include<string>
 #include<fstream>


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