diff options
Diffstat (limited to 'libkdepim/tests/testlinklocator.cpp')
-rw-r--r-- | libkdepim/tests/testlinklocator.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/libkdepim/tests/testlinklocator.cpp b/libkdepim/tests/testlinklocator.cpp index b5678fe14..39383d9d1 100644 --- a/libkdepim/tests/testlinklocator.cpp +++ b/libkdepim/tests/testlinklocator.cpp @@ -28,7 +28,7 @@ #include <string.h> #include <assert.h> -static bool check(const QString& txt, const QString& a, const QString& b) +static bool check(const TQString& txt, const TQString& a, const TQString& b) { if (a == b) { kdDebug() << txt << " : checking '" << a << "' against expected value '" << b << "'... " << "ok" << endl; @@ -40,9 +40,9 @@ static bool check(const QString& txt, const QString& a, const QString& b) return true; } -static bool checkGetEmailAddress( const QString & input, +static bool checkGetEmailAddress( const TQString & input, int atPos, - const QString & expRetVal, + const TQString & expRetVal, bool allowBadAtPos = false ) { if ( !allowBadAtPos && ( input[atPos] != '@' ) ) { @@ -51,8 +51,8 @@ static bool checkGetEmailAddress( const QString & input, exit(1); } LinkLocator ll( input, atPos ); - const QString retVal = ll.getEmailAddress(); - check( "getEmailAddress() \"" + input + "\", " + QString::number( atPos ), + const TQString retVal = ll.getEmailAddress(); + check( "getEmailAddress() \"" + input + "\", " + TQString::number( atPos ), retVal, expRetVal ); return true; } @@ -64,38 +64,38 @@ int main(int argc, char *argv[]) KApplication app( false, false ); // empty input - checkGetEmailAddress( QString(), 0, QString(), true ); + checkGetEmailAddress( TQString(), 0, TQString(), true ); // no '@' at scan position - checkGetEmailAddress( "foo@bar.baz", 0, QString(), true ); + checkGetEmailAddress( "foo@bar.baz", 0, TQString(), true ); // '@' in local part - checkGetEmailAddress( "foo@bar@bar.baz", 7, QString() ); + checkGetEmailAddress( "foo@bar@bar.baz", 7, TQString() ); // empty local part - checkGetEmailAddress( "@bar.baz", 0, QString() ); - checkGetEmailAddress( ".@bar.baz", 1, QString() ); - checkGetEmailAddress( " @bar.baz", 1, QString() ); - checkGetEmailAddress( ".!#$%&'*+-/=?^_`{|}~@bar.baz", strlen(".!#$%&'*+-/=?^_`{|}~"), QString() ); + checkGetEmailAddress( "@bar.baz", 0, TQString() ); + checkGetEmailAddress( ".@bar.baz", 1, TQString() ); + checkGetEmailAddress( " @bar.baz", 1, TQString() ); + checkGetEmailAddress( ".!#$%&'*+-/=?^_`{|}~@bar.baz", strlen(".!#$%&'*+-/=?^_`{|}~"), TQString() ); // allowed special chars in local part of address checkGetEmailAddress( "a.!#$%&'*+-/=?^_`{|}~@bar.baz", strlen("a.!#$%&'*+-/=?^_`{|}~"), "a.!#$%&'*+-/=?^_`{|}~@bar.baz" ); // '@' in domain part - checkGetEmailAddress( "foo@bar@bar.baz", 3, QString() ); + checkGetEmailAddress( "foo@bar@bar.baz", 3, TQString() ); // domain part without dot - checkGetEmailAddress( "foo@bar", 3, QString() ); - checkGetEmailAddress( "foo@bar.", 3, QString() ); - checkGetEmailAddress( ".foo@bar", 4, QString() ); - checkGetEmailAddress( "foo@bar ", 3, QString() ); - checkGetEmailAddress( " foo@bar", 4, QString() ); - checkGetEmailAddress( "foo@bar-bar", 3, QString() ); + checkGetEmailAddress( "foo@bar", 3, TQString() ); + checkGetEmailAddress( "foo@bar.", 3, TQString() ); + checkGetEmailAddress( ".foo@bar", 4, TQString() ); + checkGetEmailAddress( "foo@bar ", 3, TQString() ); + checkGetEmailAddress( " foo@bar", 4, TQString() ); + checkGetEmailAddress( "foo@bar-bar", 3, TQString() ); // empty domain part - checkGetEmailAddress( "foo@", 3, QString() ); - checkGetEmailAddress( "foo@.", 3, QString() ); - checkGetEmailAddress( "foo@-", 3, QString() ); + checkGetEmailAddress( "foo@", 3, TQString() ); + checkGetEmailAddress( "foo@.", 3, TQString() ); + checkGetEmailAddress( "foo@-", 3, TQString() ); // simple address checkGetEmailAddress( "foo@bar.baz", 3, "foo@bar.baz" ); |