diff options
Diffstat (limited to 'libkdepim/tests/testdistrlist.cpp')
-rw-r--r-- | libkdepim/tests/testdistrlist.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/libkdepim/tests/testdistrlist.cpp b/libkdepim/tests/testdistrlist.cpp index 281c5835b..b446a5a39 100644 --- a/libkdepim/tests/testdistrlist.cpp +++ b/libkdepim/tests/testdistrlist.cpp @@ -31,8 +31,8 @@ using KPIM::DistributionList; #include <kdebug.h> #include <kcmdlineargs.h> -#include <qdir.h> -#include <qfileinfo.h> +#include <tqdir.h> +#include <tqfileinfo.h> #include <stdio.h> #include <stdlib.h> @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) { // Use another directory than the real one, just to keep things clean // KDEHOME needs to be writable though, for a ksycoca database - setenv( "KDEHOME", QFile::encodeName( QDir::homeDirPath() + "/.kde-testdistrlist" ), true ); + setenv( "KDEHOME", TQFile::encodeName( TQDir::homeDirPath() + "/.kde-testdistrlist" ), true ); setenv( "KDE_FORK_SLAVES", "yes", true ); // simpler, for the final cleanup KApplication::disableAutoDcopRegistration(); @@ -94,12 +94,12 @@ void TestDistrList::runAll() testDeleteList(); } -bool TestDistrList::check(const QString& txt, QString a, QString b) +bool TestDistrList::check(const TQString& txt, TQString a, TQString b) { if (a.isEmpty()) - a = QString::null; + a = TQString::null; if (b.isEmpty()) - b = QString::null; + b = TQString::null; if (a == b) { kdDebug() << txt << " : checking '" << a << "' against expected value '" << b << "'... " << "ok" << endl; } @@ -114,18 +114,18 @@ bool TestDistrList::check(const QString& txt, QString a, QString b) // taken from KMail #include <sys/types.h> #include <dirent.h> -static bool removeDirAndContentsRecursively( const QString & path ) +static bool removeDirAndContentsRecursively( const TQString & path ) { kdDebug() << k_funcinfo << path << endl; bool success = true; - QDir d; + TQDir d; d.setPath( path ); - d.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden ); + d.setFilter( TQDir::Files | TQDir::Dirs | TQDir::Hidden ); const QFileInfoList *list = d.entryInfoList(); QFileInfoListIterator it( *list ); - QFileInfo *fi; + TQFileInfo *fi; while ( (fi = it.current()) != 0 ) { if( fi->isDir() && !fi->isSymLink() ) { @@ -150,7 +150,7 @@ void TestDistrList::cleanup() ab->clear(); KABC::StdAddressBook::close(); - QString kdehome = QFile::decodeName( getenv("KDEHOME") ); + TQString kdehome = TQFile::decodeName( getenv("KDEHOME") ); KURL urlkdehome; urlkdehome.setPath( kdehome ); // don't use KIO::NetAccess here since it needs X // KIO::NetAccess::del( urlkdehome, 0 )i; @@ -225,16 +225,16 @@ void TestDistrList::testInsertEntry() // Test entries() DistributionList::Entry::List entries = dl.entries( ab ); - check( "entries count", QString::number( entries.count() ), "3" ); + check( "entries count", TQString::number( entries.count() ), "3" ); check( "first entry", entries[0].addressee.name(), "addr1" ); - check( "first entry", entries[0].email, QString::null ); + check( "first entry", entries[0].email, TQString::null ); check( "second entry", entries[1].addressee.name(), "addr2" ); check( "second entry", entries[1].email, "[email protected]" ); check( "third entry", entries[2].addressee.name(), "addr2" ); check( "third entry", entries[2].email, "[email protected]" ); // Test emails() - QStringList emails = dl.emails( ab ); + TQStringList emails = dl.emails( ab ); kdDebug() << emails << endl; assert( emails.count() == 3 ); check( "first email", emails[0], "addr1 <[email protected]>" ); @@ -252,22 +252,22 @@ void TestDistrList::testRemoveEntry() DistributionList dl = DistributionList::findByName( ab, "foo" ); assert( !dl.isEmpty() ); DistributionList::Entry::List entries = dl.entries( ab ); - check( "entries count before removeEntry", QString::number( entries.count() ), "3" ); + check( "entries count before removeEntry", TQString::number( entries.count() ), "3" ); // Removing an empty entry shouldn't do anything dl.removeEntry( KABC::Addressee() ); - check( "entries count after removing empty entry", QString::number( dl.entries(ab).count() ), "3" ); + check( "entries count after removing empty entry", TQString::number( dl.entries(ab).count() ), "3" ); KABC::Addressee addr1 = ab->findByName( "addr1" ).first(); assert( !addr1.isEmpty() ); // Removing an entry with the wrong email passed, shouldn't do anything dl.removeEntry( addr1, "[email protected]" ); - check( "entries count after removing entry with invalid email", QString::number( dl.entries(ab).count() ), "3" ); + check( "entries count after removing entry with invalid email", TQString::number( dl.entries(ab).count() ), "3" ); // Now remove entry correctly dl.removeEntry( addr1 ); - check( "removeEntry(addr1) worked", QString::number( dl.entries(ab).count() ), "2" ); - QStringList emails = dl.emails( ab ); + check( "removeEntry(addr1) worked", TQString::number( dl.entries(ab).count() ), "2" ); + TQStringList emails = dl.emails( ab ); assert( emails.count() == 2 ); check( "first email", emails[0], "addr2 <[email protected]>" ); @@ -275,13 +275,13 @@ void TestDistrList::testRemoveEntry() KABC::Addressee addr2 = ab->findByName( "addr2" ).first(); assert( !addr2.isEmpty() ); dl.removeEntry( addr2 ); - check( "entries count after removing entry with no email", QString::number( dl.entries(ab).count() ), "2" ); + check( "entries count after removing entry with no email", TQString::number( dl.entries(ab).count() ), "2" ); // Now remove addr2 correctly dl.removeEntry( addr2, "[email protected]" ); - check( "entries count after removing addr2", QString::number( dl.entries(ab).count() ), "1" ); + check( "entries count after removing addr2", TQString::number( dl.entries(ab).count() ), "1" ); dl.removeEntry( addr2, "[email protected]" ); - check( "entries count after removing alternate addr2", QString::number( dl.entries(ab).count() ), "0" ); + check( "entries count after removing alternate addr2", TQString::number( dl.entries(ab).count() ), "0" ); assert( dl.entries(ab).isEmpty() ); assert( dl.emails(ab).isEmpty() ); assert( DistributionList::isDistributionList( dl ) ); |