$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
From: chintanraoh_at_[hidden]
Date: 2008-06-06 02:30:37
Author: chintanraoh
Date: 2008-06-06 02:30:36 EDT (Fri, 06 Jun 2008)
New Revision: 46187
URL: http://svn.boost.org/trac/boost/changeset/46187
Log:
test cases for void erase(iterator)
Text files modified: 
   sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/test/test_trie_string.cpp |    54 ++++++++++++++++++++++++++++++++++++++- 
   1 files changed, 52 insertions(+), 2 deletions(-)
Modified: sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/test/test_trie_string.cpp
==============================================================================
--- sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/test/test_trie_string.cpp	(original)
+++ sandbox/SOC/2008/digital_searching/dsearch/libs/dsearch/test/test_trie_string.cpp	2008-06-06 02:30:36 EDT (Fri, 06 Jun 2008)
@@ -226,6 +226,57 @@
         tr=tr1;
 }
 
+template<class T>
+void test_erase_iterator()
+{
+	T tr;
+	typename T::iterator it;
+
+	tr.insert(make_pair("hello",1));
+	it=tr.find("hello");
+	tr.erase(it);
+	BOOST_CHECK(tr.find("hello")==tr.end());
+
+
+	//"" 3<"hel" 4<"hellish" 7<"hello" 1<"wor" 5<"world" 2<"worry" 6
+	tr=test_insert<T>();
+
+	it=tr.find("hello");
+	tr.erase(it);
+	BOOST_CHECK(tr.find("hello")==tr.end());
+
+	it=tr.find("wor");
+	BOOST_CHECK(it!=tr.end());
+	tr.erase(it);
+	BOOST_CHECK(tr.find("wor")==tr.end());
+
+	it=tr.find("hellish");
+	BOOST_CHECK(it!=tr.end());
+	tr.erase(it);
+	BOOST_CHECK(tr.find("hellish")==tr.end());
+
+	it=tr.find("hel");
+	BOOST_CHECK(it!=tr.end());
+	tr.erase(it);
+	BOOST_CHECK(tr.find("hel")==tr.end());
+
+	it=tr.find("world");
+	BOOST_CHECK(it!=tr.end());
+	tr.erase(it);
+	BOOST_CHECK(tr.find("world")==tr.end());
+
+	it=tr.find("worry");
+	BOOST_CHECK(it!=tr.end());
+	tr.erase(it);
+	BOOST_CHECK(tr.find("worry")==tr.end());
+
+	it=tr.find("");
+	BOOST_CHECK(it!=tr.end());
+	tr.erase(it);
+	BOOST_CHECK(tr.find("")==tr.end());
+	BOOST_CHECK( tr.empty() );
+}
+
 int test_main(int,char **)
 {
         typedef trie<std::string,int,trie_array_node,string_traits> trie_type;
@@ -236,10 +287,9 @@
         test_copy(tr);
         test_bound(tr);
         test_erase(tr);
-	std::cout<<"DONE"<<std::endl;
-
         test_iteration(tr);
 
+	test_erase_iterator<trie_type>();
         return 0;
 }