[sword-cvs] sword/tests/cppunit swbuf_test.cpp,1.1,1.2

sword at www.crosswire.org sword at www.crosswire.org
Tue Jul 20 02:43:14 MST 2004


Committed by: joachim

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

Modified Files:
	swbuf_test.cpp 
Log Message:
fix

Index: swbuf_test.cpp
===================================================================
RCS file: /cvs/core/sword/tests/cppunit/swbuf_test.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- swbuf_test.cpp	16 Jul 2004 11:03:36 -0000	1.1
+++ swbuf_test.cpp	20 Jul 2004 09:43:12 -0000	1.2
@@ -32,15 +32,15 @@
 	void testAppendString() {
 		SWBuf t;
 		
-		for (int i = 0; i < 50000; ++i) {
+		for (int i = 0; i < 5000; ++i) {
 			t.append("a");
 			t.append("b");
 			t.append("ccccc",1);
 		}		
-		CPPUNIT_ASSERT( t.length() == 3*50000 );
+		CPPUNIT_ASSERT( t.length() == 3*5000 );
 		
 		char c = 'a';
-		for (int i = 0; i < 50000; ++i) { //check whether the append calls worked right
+		for (int i = 0; i < 5000; ++i) { //check whether the append calls worked right
 			CPPUNIT_ASSERT( t[i] == c );
 			
 			c = (c=='a') ? 'b' : ((c=='b') ? 'c' : 'a');
@@ -49,15 +49,15 @@
 	void testAppendChar() {
 		SWBuf t;
 		
-		for (int i = 0; i < 50000; ++i) {
+		for (int i = 0; i < 5000; ++i) {
 			t.append('a');
 			t.append('b');
 			t.append('c');
 		}		
-		CPPUNIT_ASSERT( t.length() == 3*50000 );
+		CPPUNIT_ASSERT( t.length() == 3*5000 );
 		
 		char c = 'a';
-		for (int i = 0; i < 50000; ++i) { //check whether the append calls worked right
+		for (int i = 0; i < 5000; ++i) { //check whether the append calls worked right
 			CPPUNIT_ASSERT( t[i] == c );
 			
 			c = (c=='a') ? 'b' : ((c=='b') ? 'c' : 'a');
@@ -67,44 +67,45 @@
 	void testInsertString() {
 		SWBuf t = "end";
 		
-		for (int i = 0; i < 50000; ++i) {
+		for (int i = 0; i < 5000; ++i) {
 			t.insert(0, "a");
 			t.insert(1, "b");
 			t.insert(2, "ccccccc", 1); //only one c
 		}		
-		CPPUNIT_ASSERT( t.length() == 3*50000+3 );
+		CPPUNIT_ASSERT( t.length() == 3*5000+3 );
 		
 		char c = 'a';
-		for (int i = 0; i < 50000; ++i) { //check whether the append calls worked right
+		for (int i = 0; i < 5000; ++i) { //check whether the append calls worked right
 			CPPUNIT_ASSERT( t[i] == c );
 			
 			c = (c=='a') ? 'b' : ((c=='b') ? 'c' : 'a');
 		}
 		//check if end is at the end
-		CPPUNIT_ASSERT( t[3*50000+0] == 'e');
-		CPPUNIT_ASSERT( t[3*50000+1] == 'n');
-		CPPUNIT_ASSERT( t[3*50000+2] == 'd');
-	}	
+		CPPUNIT_ASSERT( t[3*5000+0] == 'e');
+		CPPUNIT_ASSERT( t[3*5000+1] == 'n');
+		CPPUNIT_ASSERT( t[3*5000+2] == 'd');
+	}
+	
 	void testInsertChar() {
 		SWBuf t = "end";
 		
-		for (int i = 0; i < 50000; ++i) {
+		for (int i = 0; i < 5000; ++i) {
 			t.insert(0, 'a');
 			t.insert(1, 'b');
 			t.insert(2, 'c');
 		}		
-		CPPUNIT_ASSERT( t.length() == 3*50000+3 );
+		CPPUNIT_ASSERT( t.length() == 3*5000+3 );
 		
 		char c = 'a';
-		for (int i = 0; i < 50000; ++i) { //check whether the append calls worked right
+		for (int i = 0; i < 5000; ++i) { //check whether the insert calls worked right
 			CPPUNIT_ASSERT( t[i] == c );
 			
 			c = (c=='a') ? 'b' : ((c=='b') ? 'c' : 'a');
 		}
 		//check if end is at the end
-		CPPUNIT_ASSERT( t[3*50000+0] == 'e');
-		CPPUNIT_ASSERT( t[3*50000+1] == 'n');
-		CPPUNIT_ASSERT( t[3*50000+2] == 'd');
+		CPPUNIT_ASSERT( t[3*5000+0] == 'e');
+		CPPUNIT_ASSERT( t[3*5000+1] == 'n');
+		CPPUNIT_ASSERT( t[3*5000+2] == 'd');
 	}	
 	
 };



More information about the sword-cvs mailing list