[sword-cvs] sword/tests swbuftest.cpp,1.5,1.6

sword@www.crosswire.org sword@www.crosswire.org
Sun, 29 Feb 2004 16:26:19 -0700


Update of /cvs/core/sword/tests
In directory www:/tmp/cvs-serv31359/tests

Modified Files:
	swbuftest.cpp 
Log Message:
SWBuf::insert added, tested, works for me. Needed to make the gbfosis filter working (jansorg)

Index: swbuftest.cpp
===================================================================
RCS file: /cvs/core/sword/tests/swbuftest.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- swbuftest.cpp	17 Jul 2003 23:37:15 -0000	1.5
+++ swbuftest.cpp	29 Feb 2004 23:26:17 -0000	1.6
@@ -78,6 +78,23 @@
 }
 
 
+void insertStringTest() {
+	// insert test
+	cerr << "\ninsert string test -------\n";
+	cerr.flush();
+	
+	speed = "Start\nend";
+	for (int i = 0; i < 1000; ++i) {
+		speed.insert(6, "text ->this part should not appear :)", 5);
+		speed.insert(6, SWBuf("text ->this part should not appear :)"), 5);
+		//if (!(i%3))speed.append("test");
+	}
+	cout << "\ninsert string test -------\n";
+	
+	//speed = SWBuf(speed.c_str() + iterations);
+	//speed.resize(BASEI/100L);
+	cout << speed << "\n";
+}
 
 int main(int argc, char **argv) {
 	SWBuf x;
@@ -101,11 +118,11 @@
 	y.append(y.c_str(),5);
 	cout << "should be (hello wurld hello wurld from 4 dogs running 1.90000 miles!hello): (" << y << ")\n";
 
+	insertStringTest();
 	appendChTest();
 	appendStringTest();
 	subscriptTest();
 	ctorAssignTest();
 	compareTest();
-		
 }