summaryrefslogtreecommitdiffstats
path: root/tdeio/tests/kurifiltertest.cpp
diff options
context:
space:
mode:
authorAlexander Golubev <fatzer2@gmail.com>2016-12-21 01:09:27 +0300
committerSlávek Banko <slavek.banko@axis.cz>2017-01-29 02:27:15 +0100
commited74769bfaae171809c0bc1a10a8ba0f6ff8895f (patch)
tree2be1a9e1f24c538b0f682e733794336f6fe54193 /tdeio/tests/kurifiltertest.cpp
parentd556a8752c0862aa2d84a105dc8ac41b61ba7824 (diff)
downloadtdelibs-ed74769bfaae171809c0bc1a10a8ba0f6ff8895f.tar.gz
tdelibs-ed74769bfaae171809c0bc1a10a8ba0f6ff8895f.zip
tdeio: add tests
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
Diffstat (limited to 'tdeio/tests/kurifiltertest.cpp')
-rw-r--r--tdeio/tests/kurifiltertest.cpp14
1 files changed, 9 insertions, 5 deletions
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