From 86921d65c5c218a2c721d905a93885cf2fe9b7b7 Mon Sep 17 00:00:00 2001 From: Alexander Golubev Date: Wed, 21 Dec 2016 01:09:27 +0300 Subject: tdeio: add tests Signed-off-by: Alexander Golubev (cherry picked from commit ed74769bfaae171809c0bc1a10a8ba0f6ff8895f) --- tdeio/tdefile/CMakeLists.txt | 2 ++ tdeio/tdefile/tests/CMakeLists.txt | 40 +++++++++++++++++++++++++++ tdeio/tdefile/tests/kcustommenueditortest.cpp | 2 +- tdeio/tdefile/tests/kdirselectdialogtest.cpp | 2 +- tdeio/tdefile/tests/kfstest.cpp | 2 +- tdeio/tdefile/tests/kicondialogtest.cpp | 2 +- tdeio/tdefile/tests/knotifytest.cpp | 10 ------- tdeio/tdefile/tests/kopenwithtest.cpp | 2 +- tdeio/tdefile/tests/kurlrequestertest.cpp | 2 +- tdeio/tdefile/tests/tdefilenotifytest.cpp | 10 +++++++ tdeio/tdefile/tests/tdefiletreeviewtest.cpp | 2 +- tdeio/tdeio/dataprotocol.cpp | 2 +- tdeio/tests/CMakeLists.txt | 40 +++++++++++++++++++++++++++ tdeio/tests/dataprotocoltest.cpp | 4 ++- tdeio/tests/getalltest.cpp | 2 +- tdeio/tests/jobtest.cpp | 2 +- tdeio/tests/kacltest.cpp | 2 +- tdeio/tests/kdcopcheck.cpp | 6 ++-- tdeio/tests/kdefaultprogresstest.cpp | 2 +- tdeio/tests/kdirlistertest.cpp | 2 +- tdeio/tests/kmimetypetest.cpp | 21 ++++++++------ tdeio/tests/kprotocolinfotest.cpp | 2 +- tdeio/tests/kruntest.cpp | 16 +++++------ tdeio/tests/kscantest.cpp | 4 +-- tdeio/tests/kurifiltertest.cpp | 14 ++++++---- tdeio/tests/kurlcompletiontest.cpp | 2 +- tdeio/tests/netaccesstest.cpp | 2 +- tdeio/tests/previewtest.cpp | 2 +- tdeio/tests/tdeioslavetest.cpp | 2 +- tdeio/tests/tdesycocatest.cpp | 6 ++-- tdeio/tests/tdesycocaupdatetest.cpp | 2 +- 31 files changed, 152 insertions(+), 59 deletions(-) create mode 100644 tdeio/tdefile/tests/CMakeLists.txt delete mode 100644 tdeio/tdefile/tests/knotifytest.cpp create mode 100644 tdeio/tdefile/tests/tdefilenotifytest.cpp (limited to 'tdeio') diff --git a/tdeio/tdefile/CMakeLists.txt b/tdeio/tdefile/CMakeLists.txt index ed0350999..8952005ed 100644 --- a/tdeio/tdefile/CMakeLists.txt +++ b/tdeio/tdefile/CMakeLists.txt @@ -9,6 +9,8 @@ # ################################################# +add_subdirectory( tests ) + include_directories( ${TQT_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} diff --git a/tdeio/tdefile/tests/CMakeLists.txt b/tdeio/tdefile/tests/CMakeLists.txt new file mode 100644 index 000000000..4c8c0dcce --- /dev/null +++ b/tdeio/tdefile/tests/CMakeLists.txt @@ -0,0 +1,40 @@ +################################################# +# +# (C) 2016 Alexander Golubev +# fatzer2 (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${TQT_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeui + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdefile + ${CMAKE_SOURCE_DIR}/tdeio/tdeio + ${CMAKE_BINARY_DIR}/tdeio/tdefile +) + +link_directories( + ${TDECORE_LIBRARY_DIRS} +) + +tde_add_check_executable( kurlrequestertest LINK tdeio-shared ) +tde_add_check_executable( kopenwithtest LINK tdeio-shared ) +tde_add_check_executable( kdirselectdialogtest LINK tdeio-shared ) +tde_add_check_executable( kicondialogtest LINK tdeio-shared ) +tde_add_check_executable( kcustommenueditortest LINK tdeio-shared ) +tde_add_check_executable( tdefilenotifytest LINK tdeio-shared ) + +tde_add_check_executable( tdefiletreeviewtest AUTOMOC LINK tdeio-shared ) + +tde_add_check_executable( kfstest AUTOMOC + SOURCES kfstest.cpp kfdtest.cpp LINK tdeio-shared ) diff --git a/tdeio/tdefile/tests/kcustommenueditortest.cpp b/tdeio/tdefile/tests/kcustommenueditortest.cpp index 9e2189406..97e906fbe 100644 --- a/tdeio/tdefile/tests/kcustommenueditortest.cpp +++ b/tdeio/tdefile/tests/kcustommenueditortest.cpp @@ -6,7 +6,7 @@ int main(int argc, char** argv) { TDELocale::setMainCatalogue("tdelibs"); - TDEApplication app(argc, argv, "KCustomMenuEditorTest"); + TDEApplication app(argc, argv, "KCustomMenuEditorTest", true); KCustomMenuEditor editor(0); TDEConfig *cfg = new TDEConfig("kdesktop_custom_menu2"); editor.load(cfg); diff --git a/tdeio/tdefile/tests/kdirselectdialogtest.cpp b/tdeio/tdefile/tests/kdirselectdialogtest.cpp index c1178c3bc..71adee9a8 100644 --- a/tdeio/tdefile/tests/kdirselectdialogtest.cpp +++ b/tdeio/tdefile/tests/kdirselectdialogtest.cpp @@ -5,7 +5,7 @@ int main( int argc, char **argv ) { - TDEApplication app(argc, argv, "kdirselectdialogtest"); + TDEApplication app(argc, argv, "kdirselectdialogtest", true); KURL u = KDirSelectDialog::selectDirectory( (argc >= 1) ? argv[1] : TQString::null ); if ( u.isValid() ) diff --git a/tdeio/tdefile/tests/kfstest.cpp b/tdeio/tdefile/tests/kfstest.cpp index ada8d825e..021fdb3a3 100644 --- a/tdeio/tdefile/tests/kfstest.cpp +++ b/tdeio/tdefile/tests/kfstest.cpp @@ -44,7 +44,7 @@ int main(int argc, char **argv) { - TDEApplication a(argc, argv, "kfstest"); + TDEApplication a(argc, argv, "kfstest", true); TQString name1; TQStringList names; diff --git a/tdeio/tdefile/tests/kicondialogtest.cpp b/tdeio/tdefile/tests/kicondialogtest.cpp index 3000e89a0..b516ee07d 100644 --- a/tdeio/tdefile/tests/kicondialogtest.cpp +++ b/tdeio/tdefile/tests/kicondialogtest.cpp @@ -3,7 +3,7 @@ int main( int argc, char **argv ) { - TDEApplication app( argc, argv, "kicondialogtest" ); + TDEApplication app( argc, argv, "kicondialogtest", true ); // TDEIconDialog::getIcon(); diff --git a/tdeio/tdefile/tests/knotifytest.cpp b/tdeio/tdefile/tests/knotifytest.cpp deleted file mode 100644 index 1716a86a3..000000000 --- a/tdeio/tdefile/tests/knotifytest.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include - -int main( int argc, char **argv ) -{ - TDEApplication app( argc, argv, "knotifytest" ); - KNotifyDialog *dlg = new KNotifyDialog(); - dlg->addApplicationEvents( "twin" ); - return dlg->exec(); -} diff --git a/tdeio/tdefile/tests/kopenwithtest.cpp b/tdeio/tdefile/tests/kopenwithtest.cpp index 925aa7625..fe7ae3986 100644 --- a/tdeio/tdefile/tests/kopenwithtest.cpp +++ b/tdeio/tdefile/tests/kopenwithtest.cpp @@ -28,7 +28,7 @@ int main(int argc, char **argv) { - TDEApplication app(argc, argv, "kopenwithtest"); + TDEApplication app(argc, argv, "kopenwithtest", true); KURL::List list; list += KURL("file:///tmp/testfile.txt"); diff --git a/tdeio/tdefile/tests/kurlrequestertest.cpp b/tdeio/tdefile/tests/kurlrequestertest.cpp index 829055304..023603082 100644 --- a/tdeio/tdefile/tests/kurlrequestertest.cpp +++ b/tdeio/tdefile/tests/kurlrequestertest.cpp @@ -5,7 +5,7 @@ int main( int argc, char **argv ) { - TDEApplication app( argc, argv, "kurlrequestertest" ); + TDEApplication app( argc, argv, "kurlrequestertest", true ); KURL url = KURLRequesterDlg::getURL( "ftp://ftp.kde.org" ); tqDebug( "Selected url: %s", url.url().latin1()); diff --git a/tdeio/tdefile/tests/tdefilenotifytest.cpp b/tdeio/tdefile/tests/tdefilenotifytest.cpp new file mode 100644 index 000000000..10dd5959d --- /dev/null +++ b/tdeio/tdefile/tests/tdefilenotifytest.cpp @@ -0,0 +1,10 @@ +#include +#include + +int main( int argc, char **argv ) +{ + TDEApplication app( argc, argv, "knotifytest", true ); + KNotifyDialog *dlg = new KNotifyDialog(); + dlg->addApplicationEvents( "twin" ); + return dlg->exec(); +} diff --git a/tdeio/tdefile/tests/tdefiletreeviewtest.cpp b/tdeio/tdefile/tests/tdefiletreeviewtest.cpp index 9ff0199dc..da031eac2 100644 --- a/tdeio/tdefile/tests/tdefiletreeviewtest.cpp +++ b/tdeio/tdefile/tests/tdefiletreeviewtest.cpp @@ -134,7 +134,7 @@ void testFrame::slotSetChildCount( KFileTreeViewItem *item, int c ) int main(int argc, char **argv) { - TDEApplication a(argc, argv, "tdefiletreeviewtest"); + TDEApplication a(argc, argv, "tdefiletreeviewtest", true); TQString name1; TQStringList names; diff --git a/tdeio/tdeio/dataprotocol.cpp b/tdeio/tdeio/dataprotocol.cpp index 62ba52a6b..efbf549ad 100644 --- a/tdeio/tdeio/dataprotocol.cpp +++ b/tdeio/tdeio/dataprotocol.cpp @@ -33,7 +33,7 @@ # include #endif #ifdef TESTKIO -# include +# include #endif #if !defined(DATAKIOSLAVE) && !defined(TESTKIO) diff --git a/tdeio/tests/CMakeLists.txt b/tdeio/tests/CMakeLists.txt index a9f6bd4ef..b8b9a411a 100644 --- a/tdeio/tests/CMakeLists.txt +++ b/tdeio/tests/CMakeLists.txt @@ -11,8 +11,14 @@ include_directories( ${TQT_INCLUDE_DIRS} + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/dcop ${CMAKE_BINARY_DIR}/tdecore ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeui + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdefile ${CMAKE_SOURCE_DIR}/tdeio/tdeio ) @@ -34,3 +40,37 @@ tde_add_executable( ${target} LINK tdeio-shared DESTINATION ${BIN_INSTALL_DIR} ) + + +##### check and test ############################## + +# Force assertions to work +add_definitions( -UNDEBUG ) + +set( CHECKS + getalltest jobtest kdcopcheck kdefaultprogresstest kdirlistertest + kdirwatchtest kfiltertest kionetrctest kiopassdlgtest kmfitest kmimefromext + kmimemagictest kpropsdlgtest kprotocolinfotest kruntest kscantest kshredtest + ktartest kurifiltertest kurlcompletiontest kziptest metatest netaccesstest + previewtest speed tdeioslavetest tdesycocatest tdesycocaupdatetest +) + +foreach( _check ${CHECKS} ) + tde_add_check_executable( ${_check} AUTOMOC LINK tdeio-shared ) +endforeach( ) + +# NOTE some apps here are suitable to be run as tests but not included due to +# following reasons: +# - jobtest may fail if run on an unusual system configuration +# and requires GUI +# - kprotocolinfotest tries to connect to network and requires running DCOP +# - kurifiltertest requires network access and GUI +# - tdesycocatest requires installed tdebase and GUI + +set( TESTS dataprotocoltest kacltest kmimetypetest ) + +foreach( _check ${TESTS} ) + tde_add_check_executable( ${_check} AUTOMOC LINK tdeio-shared TEST) +endforeach( ) + +# TODO add kdirwatchunittest diff --git a/tdeio/tests/dataprotocoltest.cpp b/tdeio/tests/dataprotocoltest.cpp index e9af8574d..2cdcf36d4 100644 --- a/tdeio/tests/dataprotocoltest.cpp +++ b/tdeio/tests/dataprotocoltest.cpp @@ -21,7 +21,9 @@ #include #include -#include +#include + +using namespace std; class KURL; diff --git a/tdeio/tests/getalltest.cpp b/tdeio/tests/getalltest.cpp index 37f9b1ab2..96d39c3c2 100644 --- a/tdeio/tests/getalltest.cpp +++ b/tdeio/tests/getalltest.cpp @@ -7,7 +7,7 @@ int main(int argc, char *argv[]) { - TDEApplication k(argc,argv,"getalltest",false/*noGUI*/); // KMessageBox needs KApp for makeStdCaption + TDEApplication k(argc,argv,"getalltest",false/*nostyle*/,false/*noGUI*/); // KMessageBox needs KApp for makeStdCaption //for (int i = 0 ; i < 2 ; ++i ) { // test twice to see if they got deleted kdDebug() << "All services" << endl; diff --git a/tdeio/tests/jobtest.cpp b/tdeio/tests/jobtest.cpp index 076bc250d..7df3ff3f0 100644 --- a/tdeio/tests/jobtest.cpp +++ b/tdeio/tests/jobtest.cpp @@ -200,7 +200,7 @@ void JobTest::get() kapp->eventLoop()->enterLoop(); assert( m_result == 0 ); // no error assert( m_data.size() == 11 ); - assert( TQCString( m_data ) == "Hello world" ); + assert( memcmp (m_data, "Hello world", m_data.size()) == 0 ); // m_data is not null-terminated } void JobTest::slotGetResult( TDEIO::Job* job ) diff --git a/tdeio/tests/kacltest.cpp b/tdeio/tests/kacltest.cpp index 50d3bc25a..94aa31f9f 100644 --- a/tdeio/tests/kacltest.cpp +++ b/tdeio/tests/kacltest.cpp @@ -69,7 +69,7 @@ int main(int argc, char *argv[]) { TDEApplication::disableAutoDcopRegistration(); TDECmdLineArgs::init(argc,argv,"kacltest", 0, 0, 0, 0); - TDEApplication app; + TDEApplication app(/*styles=*/false, /*gui=*/false); KACLTest test; test.setup(); diff --git a/tdeio/tests/kdcopcheck.cpp b/tdeio/tests/kdcopcheck.cpp index 5f1ad611a..e99de7e79 100644 --- a/tdeio/tests/kdcopcheck.cpp +++ b/tdeio/tests/kdcopcheck.cpp @@ -90,14 +90,14 @@ int TestService::exec() int main(int argc, char *argv[]) { - putenv("IGNORE_SYCOCA_VERSION=true"); - TDEApplication k(argc,argv,"whatever",false/*noGUI*/); // KMessageBox needs KApp for makeStdCaption + setenv("IGNORE_SYCOCA_VERSION", "true", true); + TDEApplication k(argc,argv,"whatever",false/*nostyle*/,false/*noGUI*/); // KMessageBox needs KApp for makeStdCaption k.dcopClient()->setNotifications(true); KService::List list = KService::allServices(); - tqWarning("I found %d services.", list.count()); + tqWarning("I found %ld services.", list.count()); int i = 0; for(KService::List::ConstIterator it = list.begin(); it != list.end(); ++it) { diff --git a/tdeio/tests/kdefaultprogresstest.cpp b/tdeio/tests/kdefaultprogresstest.cpp index 7f1bad6a4..b3f778772 100644 --- a/tdeio/tests/kdefaultprogresstest.cpp +++ b/tdeio/tests/kdefaultprogresstest.cpp @@ -7,7 +7,7 @@ using namespace TDEIO; int main(int argc, char **argv) { - TDEApplication app(argc, argv, "kdefaultprogresstest"); + TDEApplication app(argc, argv, "kdefaultprogresstest",true,true); DefaultProgress* dlg = new DefaultProgress(); KURL src("http://this.host.doesn't.exist/this/dir/neither/andthisfileneither"); diff --git a/tdeio/tests/kdirlistertest.cpp b/tdeio/tests/kdirlistertest.cpp index aaba5400a..b1208f41d 100644 --- a/tdeio/tests/kdirlistertest.cpp +++ b/tdeio/tests/kdirlistertest.cpp @@ -151,7 +151,7 @@ void KDirListerTest::completed() int main ( int argc, char *argv[] ) { - TDEApplication app( argc, argv, "kdirlistertest" ); + TDEApplication app( argc, argv, "kdirlistertest", true /*styles*/ ); KDirListerTest *test = new KDirListerTest( 0 ); test->show(); diff --git a/tdeio/tests/kmimetypetest.cpp b/tdeio/tests/kmimetypetest.cpp index 5d963c81c..631521c8a 100644 --- a/tdeio/tests/kmimetypetest.cpp +++ b/tdeio/tests/kmimetypetest.cpp @@ -36,6 +36,17 @@ static void checkIcon( const KURL& url, const TQString& expectedIcon ) } } +static void checkExtention( const TQString& fileName, const TQString& expectedExtention ) { + TQString ext; + KMimeType::diagnoseFileName(fileName, ext); + if ( ext == expectedExtention) { + tqDebug("extension of %s is '%s: OK'", fileName.latin1(), ext.latin1()); + } else { + tqDebug("extension of %s is '%s, expected %s!'", fileName.latin1(), ext.latin1(), expectedExtention.latin1()); + exit(1); + } +} + int main( int argc, char** argv ) { TDEInstance blah("kmimetypetest"); @@ -63,14 +74,8 @@ int main( int argc, char** argv ) checkIcon( "trash:/foo/", "folder" ); } - TQString pdf; - KMimeType::diagnoseFileName("foo.pdf", pdf); - tqDebug("extension: '%s'", pdf.latin1()); - assert(pdf == TQString("*.pdf")); - TQString ps; - KMimeType::diagnoseFileName("foo.ps", ps); - tqDebug("extension: '%s'", ps.latin1()); - assert(ps == TQString("*.ps")); + checkExtention(TQString::fromLatin1("foo.pdf"), TQString::fromLatin1("*.pdf")); + checkExtention(TQString::fromLatin1("foo.ps"), TQString::fromLatin1("*.ps")); return 0; } diff --git a/tdeio/tests/kprotocolinfotest.cpp b/tdeio/tests/kprotocolinfotest.cpp index 9b5242d65..d951f3696 100644 --- a/tdeio/tests/kprotocolinfotest.cpp +++ b/tdeio/tests/kprotocolinfotest.cpp @@ -30,7 +30,7 @@ int main(int argc, char **argv) { "1.0"); TDECmdLineArgs::init(argc, argv, &aboutData); - TDEApplication app; + TDEApplication app(/*styles=*/false, /*gui=*/false); KURL url; url.setPath("/tmp"); diff --git a/tdeio/tests/kruntest.cpp b/tdeio/tests/kruntest.cpp index f2065f8b8..7562b488a 100644 --- a/tdeio/tests/kruntest.cpp +++ b/tdeio/tests/kruntest.cpp @@ -121,7 +121,7 @@ void checkPDE(const KService &service, const KURL::List &urls, bool hs, bool tf, int main(int argc, char **argv) { - TDEApplication app( argc, argv, "kruntest", true /* it _has_ a GUI ! */); + TDEApplication app( argc, argv, "kruntest", true /*styles*/, true /* it _has_ a GUI ! */); // First some non-interactive tests checkBN( "/usr/bin/ls", true, "ls"); @@ -164,16 +164,16 @@ int main(int argc, char **argv) for (int te = 0; te < 2; te++) for (int ex = 0; ex < 2; ex++) { int fd = creat("kruntest.desktop", 0666); - FILE *f; + FILE *f; if (fd < 0) abort(); - f = KDE_fdopen(fd, "w"); + f = KDE_fdopen(fd, "w"); fprintf(f, "[Desktop Entry]\n" - "Type=Application\n" - "Name=just_a_test\n" - "Icon=~/icon.png\n" - "%s\n%s\n%s\n",execs[ex],terms[te],sus[su]); + "Type=Application\n" + "Name=just_a_test\n" + "Icon=~/icon.png\n" + "%s\n%s\n%s\n",execs[ex],terms[te],sus[su]); close(fd); - fclose(f); + fclose(f); KService s(TQDir::currentDirPath() + "/kruntest.desktop"); unlink("kruntest.desktop"); checkPDE( s, l0, hs, false, rslts[ex+te*2+su*4+hs*8]); diff --git a/tdeio/tests/kscantest.cpp b/tdeio/tests/kscantest.cpp index d37f2eb97..f28635c1c 100644 --- a/tdeio/tests/kscantest.cpp +++ b/tdeio/tests/kscantest.cpp @@ -3,11 +3,11 @@ int main( int argc, char **argv ) { - TDEApplication app( argc, argv, "kscantest" ); + TDEApplication app( argc, argv, "kscantest", true, true ); KScanDialog *dlg = KScanDialog::getScanDialog(); if ( !dlg ) { tqDebug("*** EEK, no Scan-service available, aborting!"); - return 0; + return EXIT_FAILURE; } dlg->show(); diff --git a/tdeio/tests/kurifiltertest.cpp b/tdeio/tests/kurifiltertest.cpp index 5cc79bd82..d9f6cdf87 100644 --- a/tdeio/tests/kurifiltertest.cpp +++ b/tdeio/tests/kurifiltertest.cpp @@ -155,14 +155,14 @@ int main(int argc, char **argv) { // Ensure that user configuration doesn't change the results of those tests // TDEHOME needs to be writable though, for a tdesycoca database - setenv( "TDEHOME", TQFile::encodeName( TQDir::homeDirPath() + "/.tde-kurifiltertest" ), true ); + setenv( "TDEHOME", TQFile::encodeName( TQDir::currentDirPath() + "/.tde-kurifiltertest" ), true ); setenv( "TDE_FORK_SLAVES", "yes", true ); // simpler, for the final cleanup TDEAboutData aboutData(appName, programName, version, description); TDECmdLineArgs::init(argc, argv, &aboutData); TDECmdLineArgs::addCmdLineOptions( options ); - TDEApplication app; + TDEApplication app; // it _is_ GUI app app.disableAutoDcopRegistration(); // Allow testing of the search engine using both delimiters... @@ -294,7 +294,9 @@ int main(int argc, char **argv) filter( "$SOMEVAR/tdelibs/tdeio", 0, KURIFilterData::ERROR ); // note: this dir doesn't exist... filter( "$ETC/passwd", "/etc/passwd", KURIFilterData::LOCAL_FILE ); - filter( "$QTDIR/doc/html/functions.html#s", TQCString("file://")+qtdir+"/doc/html/functions.html#s", KURIFilterData::LOCAL_FILE ); + if( !qtdir.isEmpty() ) { + filter( "$QTDIR/doc/html/functions.html#s", TQCString("file://")+qtdir+"/doc/html/functions.html#s", KURIFilterData::LOCAL_FILE ); + } filter( "http://www.kde.org/$USER", "http://www.kde.org/$USER", KURIFilterData::NET_PROTOCOL ); // no expansion // Assume the default (~/.trinity) if @@ -333,13 +335,15 @@ int main(int argc, char **argv) // the shortURI filter will return the string // itself if the requested environment variable // is not already set. - filter( "$QTDIR", 0, KURIFilterData::LOCAL_DIR, "tdeshorturifilter" ); //use specific filter. + if( !qtdir.isEmpty() ) { + filter( "$QTDIR", 0, KURIFilterData::LOCAL_DIR, "tdeshorturifilter" ); //use specific filter. + } filter( "$HOME", home, KURIFilterData::LOCAL_DIR, "tdeshorturifilter" ); //use specific filter. TQCString sc; filter( sc.sprintf("gg%cfoo bar",delimiter), "http://www.google.com/search?q=foo+bar&ie=UTF-8&oe=UTF-8", KURIFilterData::NET_PROTOCOL ); - filter( sc.sprintf("bug%c55798", delimiter), "http://bugs.kde.org/show_bug.cgi?id=55798", KURIFilterData::NET_PROTOCOL ); + filter( sc.sprintf("bug%c55798", delimiter), "http://bugs.pearsoncomputing.net/show_bug.cgi?id=55798", KURIFilterData::NET_PROTOCOL ); filter( sc.sprintf("gg%cC++", delimiter), "http://www.google.com/search?q=C%2B%2B&ie=UTF-8&oe=UTF-8", KURIFilterData::NET_PROTOCOL ); filter( sc.sprintf("ya%cfoo bar was here", delimiter), 0, -1 ); // this triggers default search, i.e. google diff --git a/tdeio/tests/kurlcompletiontest.cpp b/tdeio/tests/kurlcompletiontest.cpp index 7d479d156..fada144d5 100644 --- a/tdeio/tests/kurlcompletiontest.cpp +++ b/tdeio/tests/kurlcompletiontest.cpp @@ -166,7 +166,7 @@ int main( int argc, char **argv ) { TDEApplication::disableAutoDcopRegistration(); TDECmdLineArgs::init(argc,argv,"kurlcompletiontest", 0, 0, 0, 0); - TDEApplication app; + TDEApplication app(/*styles=*/false, /*gui=*/false); { KURLCompletionTest test; diff --git a/tdeio/tests/netaccesstest.cpp b/tdeio/tests/netaccesstest.cpp index b9b0ffab7..12404945b 100644 --- a/tdeio/tests/netaccesstest.cpp +++ b/tdeio/tests/netaccesstest.cpp @@ -24,7 +24,7 @@ int main(int argc, char **argv) { - TDEApplication app( argc, argv, "netaccesstest", true /* it _has_ a GUI ! */); + TDEApplication app( argc, argv, "netaccesstest", true /*styles*/, true /* it _has_ a GUI ! */); KURL srcURL( "ftp://ftp.kde.org/pub/kde/README" ); KURL tmpURL( "file:/tmp/netaccesstest_README" ); diff --git a/tdeio/tests/previewtest.cpp b/tdeio/tests/previewtest.cpp index 6d0cd78b2..3237f0180 100644 --- a/tdeio/tests/previewtest.cpp +++ b/tdeio/tests/previewtest.cpp @@ -55,7 +55,7 @@ void PreviewTest::slotFailed() int main(int argc, char **argv) { - TDEApplication app(argc, argv, "previewtest"); + TDEApplication app(argc, argv, "previewtest", true, true); PreviewTest *w = new PreviewTest; w->show(); app.setMainWidget(w); diff --git a/tdeio/tests/tdeioslavetest.cpp b/tdeio/tests/tdeioslavetest.cpp index 3cc22d8e2..4d52eab2e 100644 --- a/tdeio/tests/tdeioslavetest.cpp +++ b/tdeio/tests/tdeioslavetest.cpp @@ -452,7 +452,7 @@ void KioslaveTest::slotDataReq(TDEIO::Job*, TQByteArray &data) "Hello world\n", "This is a test file\n", "You can safely delete it.\n", - "BIG\n", + "BIG\n", 0 }; const char *fileData = fileDataArray[putBuffer++]; diff --git a/tdeio/tests/tdesycocatest.cpp b/tdeio/tests/tdesycocatest.cpp index 67b6b55ba..f21402405 100644 --- a/tdeio/tests/tdesycocatest.cpp +++ b/tdeio/tests/tdesycocatest.cpp @@ -43,7 +43,7 @@ bool check(TQString txt, TQString a, TQString b) kdDebug() << txt << " : checking '" << a << "' against expected value '" << b << "'... " << "ok" << endl; } else { - kdDebug() << txt << " : checking '" << a << "' against expected value '" << b << "'... " << "KO !" << endl + kdError() << txt << " : checking '" << a << "' against expected value '" << b << "'... " << "KO !" << endl ; exit(1); } @@ -52,7 +52,7 @@ bool check(TQString txt, TQString a, TQString b) void debug(TQString txt) { - fprintf(stderr, "%s\n", txt.ascii()); + fprintf(stderr, "%s\n", txt.utf8().data()); } void debug(const char *txt) @@ -67,7 +67,7 @@ void debug(const char *format, const char *txt) int main(int argc, char *argv[]) { - TDEApplication k(argc,argv,"whatever",false/*noGUI*/); // KMessageBox needs KApp for makeStdCaption + TDEApplication k(argc,argv,"whatever",true); // KMessageBox needs KApp for makeStdCaption TQCString instname = "kword"; TQString desktopPath = TQString::fromLatin1( "Office/%1.desktop" ).arg( instname ); diff --git a/tdeio/tests/tdesycocaupdatetest.cpp b/tdeio/tests/tdesycocaupdatetest.cpp index 48a195a00..5b390efa6 100644 --- a/tdeio/tests/tdesycocaupdatetest.cpp +++ b/tdeio/tests/tdesycocaupdatetest.cpp @@ -4,7 +4,7 @@ int main(int argc, char *argv[]) { - TDEApplication k(argc,argv,"whatever"); // KMessageBox needs KApp for makeStdCaption + TDEApplication k(argc,argv,"whatever",true,true); // KMessageBox needs KApp for makeStdCaption KService::rebuildKSycoca(0); return 0; -- cgit v1.2.1