diff options
Diffstat (limited to 'kmail/tests')
-rw-r--r-- | kmail/tests/messagedicttests.cpp | 2 | ||||
-rw-r--r-- | kmail/tests/mimelibtests.cpp | 18 | ||||
-rw-r--r-- | kmail/tests/mimelibtests.h | 6 | ||||
-rw-r--r-- | kmail/tests/utiltests.cpp | 82 | ||||
-rw-r--r-- | kmail/tests/utiltests.h | 2 |
5 files changed, 55 insertions, 55 deletions
diff --git a/kmail/tests/messagedicttests.cpp b/kmail/tests/messagedicttests.cpp index 063fc1cb4..cdb24f6d8 100644 --- a/kmail/tests/messagedicttests.cpp +++ b/kmail/tests/messagedicttests.cpp @@ -11,7 +11,7 @@ #include "messagedicttests.h" -static void p( const QString & str ) +static void p( const TQString & str ) { kdDebug() << str << endl; } diff --git a/kmail/tests/mimelibtests.cpp b/kmail/tests/mimelibtests.cpp index 8d9cf9e78..b152fdcf6 100644 --- a/kmail/tests/mimelibtests.cpp +++ b/kmail/tests/mimelibtests.cpp @@ -32,39 +32,39 @@ KUNITTEST_MODULE_REGISTER_TESTER( MimeLibTester ); #include <mimelib/string.h> #include <mimelib/message.h> #include "util.h" -#include <qfile.h> +#include <tqfile.h> #include <assert.h> #if 0 -static QString makePrintable( const QCString& str ) +static TQString makePrintable( const TQCString& str ) { - QString a = str; + TQString a = str; a = a.replace( '\r', "\\r" ); a = a.replace( '\n', "\\n" ); return a; } #endif -static QString makePrintable( const DwString& str ) +static TQString makePrintable( const DwString& str ) { - QString a = KMail::Util::CString( str ); // ## we assume latin1 + TQString a = KMail::Util::CString( str ); // ## we assume latin1 a = a.replace( '\r', "\\r" ); a = a.replace( '\n', "\\n" ); return a; } -QCString MimeLibTester::readFile(const QString& fileName) +TQCString MimeLibTester::readFile(const TQString& fileName) { - QFile file( fileName ); + TQFile file( fileName ); // #!@#$& kunittest... VERIFY() does nothing in setUp. Using assert instead. bool ok = file.open( IO_ReadOnly ); if ( !ok ) { kdError() << fileName << " not found!" << endl; abort(); } - QByteArray data = file.readAll(); + TQByteArray data = file.readAll(); assert( data.size() > 1 ); - QCString result; + TQCString result; KMail::Util::setFromByteArray( result, data ); return result; } diff --git a/kmail/tests/mimelibtests.h b/kmail/tests/mimelibtests.h index 3c0dad71c..e12bc15f6 100644 --- a/kmail/tests/mimelibtests.h +++ b/kmail/tests/mimelibtests.h @@ -33,11 +33,11 @@ public slots: void test_dwMessage_AsString(); private: - QCString readFile(const QString& fileName); + TQCString readFile(const TQString& fileName); bool test_dwMessage_AsString( const DwString& ); - QCString mMultipartMixedMail; - QCString mSignedMail; + TQCString mMultipartMixedMail; + TQCString mSignedMail; }; #endif /* MIMELIBTEST_H */ diff --git a/kmail/tests/utiltests.cpp b/kmail/tests/utiltests.cpp index 6f09416ff..22c141669 100644 --- a/kmail/tests/utiltests.cpp +++ b/kmail/tests/utiltests.cpp @@ -27,46 +27,46 @@ void UtilTester::tearDown() kdDebug() << "tearDown" << endl; } -static QString makePrintable( const QCString& str ) +static TQString makePrintable( const TQCString& str ) { - QString a = str; + TQString a = str; a = a.replace( '\r', "\\r" ); a = a.replace( '\n', "\\n" ); return a; } -static QString makePrintable( const QByteArray& arr ) +static TQString makePrintable( const TQByteArray& arr ) { - QCString str; + TQCString str; KMail::Util::setFromByteArray( str, arr ); return makePrintable( str ); } void UtilTester::test_lf2crlf() { - QCString src = "\nfoo\r\n\nbar\rblah\n\r\r\n\n\r"; - QCString conv = KMail::Util::lf2crlf( src ); + TQCString src = "\nfoo\r\n\nbar\rblah\n\r\r\n\n\r"; + TQCString conv = KMail::Util::lf2crlf( src ); COMPARE( makePrintable( conv ), makePrintable("\r\nfoo\r\n\r\nbar\rblah\r\n\r\r\n\r\n\r") ); - COMPARE( KMail::Util::lf2crlf( QCString("") ), QCString("") ); + COMPARE( KMail::Util::lf2crlf( TQCString("") ), TQCString("") ); - // QByteArray version - QByteArray arr; KMail::Util::setFromQCString( arr, src ); + // TQByteArray version + TQByteArray arr; KMail::Util::setFromQCString( arr, src ); COMPARE( arr[arr.size()-1], '\r' ); - QByteArray arrConv = KMail::Util::lf2crlf( arr ); + TQByteArray arrConv = KMail::Util::lf2crlf( arr ); COMPARE( arrConv[arrConv.size()-1], '\r' ); COMPARE( makePrintable( arrConv ), makePrintable("\r\nfoo\r\n\r\nbar\rblah\r\n\r\r\n\r\n\r") ); - QByteArray empty; + TQByteArray empty; arrConv = KMail::Util::lf2crlf( empty ); - COMPARE( makePrintable( arrConv ), QString("") ); + COMPARE( makePrintable( arrConv ), TQString("") ); } void UtilTester::test_crlf2lf() { - QCString src = "\r\n\r\nfoo\r\n\r\nbar\rblah\r\n\r\r\n\r\n\r"; + TQCString src = "\r\n\r\nfoo\r\n\r\nbar\rblah\r\n\r\r\n\r\n\r"; int len = src.length(); COMPARE( src[len], '\0' ); int newLen = KMail::Util::crlf2lf( src.data(), len ); VERIFY( newLen <= len ); - QCString cstr( src.data(), newLen + 1 ); + TQCString cstr( src.data(), newLen + 1 ); COMPARE( makePrintable( cstr ), makePrintable("\n\nfoo\n\nbar\rblah\n\r\n\n\r") ); } @@ -78,40 +78,40 @@ void UtilTester::test_escapeFrom() void UtilTester::test_append() { - QCString test; - QCString str = "foo"; + TQCString test; + TQCString str = "foo"; COMPARE( (int)str.size(), 4 ); // trailing nul included - QByteArray s1 = KMail::Util::byteArrayFromQCStringNoDetach( str ); + TQByteArray s1 = KMail::Util::byteArrayFromQCStringNoDetach( str ); COMPARE( (int)s1.size(), 3 ); COMPARE( (int)str.size(), 3 ); // trailing nul got removed COMPARE( s1.data(), str.data() ); // yes, no detach COMPARE( s1[2], 'o' ); - QCString bar( "bar" ); - QByteArray s2 = KMail::Util::byteArrayFromQCStringNoDetach( bar ); + TQCString bar( "bar" ); + TQByteArray s2 = KMail::Util::byteArrayFromQCStringNoDetach( bar ); COMPARE( (int)s2.size(), 3 ); KMail::Util::append( s1, s2 ); COMPARE( (int)s1.size(), 6 ); KMail::Util::setFromByteArray( test, s1 ); - COMPARE( test, QCString( "foobar" ) ); + COMPARE( test, TQCString( "foobar" ) ); KMail::Util::append( s1, 0 ); // no-op COMPARE( (int)s1.size(), 6 ); KMail::Util::setFromByteArray( test, s1 ); - COMPARE( test, QCString( "foobar" ) ); + COMPARE( test, TQCString( "foobar" ) ); KMail::Util::append( s1, "blah" ); COMPARE( (int)s1.size(), 10 ); KMail::Util::setFromByteArray( test, s1 ); - COMPARE( test, QCString( "foobarblah" ) ); + COMPARE( test, TQCString( "foobarblah" ) ); - KMail::Util::append( s1, QCString( " str" ) ); + KMail::Util::append( s1, TQCString( " str" ) ); COMPARE( (int)s1.size(), 14 ); KMail::Util::setFromByteArray( test, s1 ); - COMPARE( test, QCString( "foobarblah str" ) ); + COMPARE( test, TQCString( "foobarblah str" ) ); - QByteArray empty; + TQByteArray empty; KMail::Util::append( empty, "a" ); COMPARE( (int)empty.size(), 1 ); COMPARE( empty[0], 'a' ); @@ -119,48 +119,48 @@ void UtilTester::test_append() void UtilTester::test_insert() { - QCString test; - QCString str = "foo"; + TQCString test; + TQCString str = "foo"; COMPARE( (int)str.size(), 4 ); // trailing nul included - QByteArray s1; + TQByteArray s1; KMail::Util::setFromQCString( s1, str ); KMail::Util::insert( s1, 1, "bar" ); COMPARE( (int)s1.size(), 6 ); - COMPARE( makePrintable(s1), QString( "fbaroo" ) ); + COMPARE( makePrintable(s1), TQString( "fbaroo" ) ); KMail::Util::insert( s1, 6, "END" ); COMPARE( (int)s1.size(), 9 ); - COMPARE( makePrintable(s1), QString( "fbarooEND" ) ); + COMPARE( makePrintable(s1), TQString( "fbarooEND" ) ); KMail::Util::insert( s1, 0, "BEGIN" ); COMPARE( (int)s1.size(), 14 ); - COMPARE( makePrintable(s1), QString( "BEGINfbarooEND" ) ); + COMPARE( makePrintable(s1), TQString( "BEGINfbarooEND" ) ); } -void UtilTester::test_DwStringConversions( const QCString& cstr ) +void UtilTester::test_DwStringConversions( const TQCString& cstr ) { // QCString->DwString->QCString COMPARE( (int)cstr.size(), 8 ); DwString dwstr = KMail::Util::dwString( cstr ); COMPARE( (int)dwstr.size(), 7 ); COMPARE( dwstr[6], 'r' ); - QCString cstr2 = KMail::Util::CString( dwstr ); + TQCString cstr2 = KMail::Util::CString( dwstr ); COMPARE( (int)cstr2.size(), 8 ); COMPARE( cstr2, cstr ); COMPARE( cstr2[6], 'r' ); // And also QCString->QByteArray - QByteArray arr; + TQByteArray arr; KMail::Util::setFromQCString( arr, cstr ); COMPARE( (int)arr.size(), 7 ); COMPARE( arr[6], 'r' ); - KMail::Util::setFromQCString( arr, QCString() ); + KMail::Util::setFromQCString( arr, TQCString() ); COMPARE( (int)arr.size(), 0 ); // DwString->QByteArray - QByteArray ba = KMail::Util::ByteArray( dwstr ); + TQByteArray ba = KMail::Util::ByteArray( dwstr ); COMPARE( (int)ba.size(), 7 ); COMPARE( ba[6], 'r' ); @@ -170,27 +170,27 @@ void UtilTester::test_DwStringConversions( const QCString& cstr ) void UtilTester::test_DwStringConversions() { - QCString cstr = "foo&bar"; + TQCString cstr = "foo&bar"; test_DwStringConversions( cstr ); // now embed a nul. Note that cstr="foo\0bar" wouldn't work. cstr[3] = '\0'; test_DwStringConversions( cstr ); - cstr = QCString(); + cstr = TQCString(); DwString dwstr = KMail::Util::dwString( cstr ); COMPARE( (int)dwstr.size(), 0 ); VERIFY( dwstr.empty() ); - dwstr = KMail::Util::dwString( QByteArray() ); + dwstr = KMail::Util::dwString( TQByteArray() ); COMPARE( (int)dwstr.size(), 0 ); VERIFY( dwstr.empty() ); } void UtilTester::test_QByteArrayQCString() { - QCString str = "foobar"; + TQCString str = "foobar"; COMPARE( (int)str.size(), 7 ); // trailing nul included - QByteArray s1 = KMail::Util::byteArrayFromQCStringNoDetach( str ); + TQByteArray s1 = KMail::Util::byteArrayFromQCStringNoDetach( str ); COMPARE( (int)str.size(), 6 ); // trailing nul got removed COMPARE( s1.data(), str.data() ); // yes, no detach COMPARE( s1[5], 'r' ); diff --git a/kmail/tests/utiltests.h b/kmail/tests/utiltests.h index 58de40901..2270cbcfd 100644 --- a/kmail/tests/utiltests.h +++ b/kmail/tests/utiltests.h @@ -24,7 +24,7 @@ public slots: void test_DwStringConversions(); void test_QByteArrayQCString(); private: - void test_DwStringConversions( const QCString& cstr ); + void test_DwStringConversions( const TQCString& cstr ); }; #endif |