[sword-cvs] sword/tests/cppunit stringmgr_test.cpp, 1.1, 1.2 Makefile.am, 1.3, 1.4

sword at www.crosswire.org sword at www.crosswire.org
Tue Jul 20 05:53:39 MST 2004


Committed by: joachim

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

Modified Files:
	stringmgr_test.cpp Makefile.am 
Log Message:
fixed ICUStringMgr, so upperUtf8 works if ICU is used. Tested with ICu 2.8 (ICU is not very friendly to API newbies)

Index: stringmgr_test.cpp
===================================================================
RCS file: /cvs/core/sword/tests/cppunit/stringmgr_test.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- stringmgr_test.cpp	20 Jul 2004 11:22:26 -0000	1.1
+++ stringmgr_test.cpp	20 Jul 2004 12:53:37 -0000	1.2
@@ -5,6 +5,7 @@
 #include "stringmgr.h"
 
 using namespace sword;
+using namespace std;
 
 class StringMgrTest : public CppUnit::TestFixture  {
 CPPUNIT_TEST_SUITE( StringMgrTest );
@@ -22,13 +23,19 @@
 		StringMgr* mgr = StringMgr::getSystemStringMgr();
 		
 		CPPUNIT_ASSERT( !strcmp(mgr->upperLatin1(""), "") );
-		CPPUNIT_ASSERT( !strcmp(mgr->upperLatin1("hi this is a test"), "HI THIS IS A TEST") );
+		
+		char t[10] = "Test!";
+		const char* ret = mgr->upperLatin1(t);
+		cout << ret << endl;
+		CPPUNIT_ASSERT( ret && !strcmp(ret, "TEST!") );
 	}
 	
 	void testUpperUTF8() {
 		StringMgr* mgr = StringMgr::getSystemStringMgr();
 		if (mgr->hasUTF8Support()) {
-			CPPUNIT_ASSERT( !strcmp(mgr->upperUTF8("äüöß"), "ÄÜÖß") );
+			char t[10] = "hi";
+			char* ret = mgr->upperUTF8(t);
+			CPPUNIT_ASSERT( ret && !strcmp(ret, "HI") );
 		}	
 	}
 };

Index: Makefile.am
===================================================================
RCS file: /cvs/core/sword/tests/cppunit/Makefile.am,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Makefile.am	16 Jul 2004 11:04:06 -0000	1.3
+++ Makefile.am	20 Jul 2004 12:53:37 -0000	1.4
@@ -3,7 +3,7 @@
 # Rules for the test code (use `make check` to execute)
 TESTS = LibSword
 check_PROGRAMS = $(TESTS)
-LibSword_SOURCES = main.cpp url_test.cpp versekey_test.cpp swbuf_test.cpp
+LibSword_SOURCES = main.cpp stringmgr_test.cpp swbuf_test.cpp url_test.cpp versekey_test.cpp 
 LibSword_CXXFLAGS = $(CPPUNIT_CFLAGS)
 LibSword_LDFLAGS = -lcppunit -ldl
 



More information about the sword-cvs mailing list