Browse Source

tdeio: add tests

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
pull/1/head
Alexander Golubev 2 years ago
parent
commit
ed74769bfa

+ 2
- 0
tdeio/tdefile/CMakeLists.txt View File

@@ -9,6 +9,8 @@
9 9
 #
10 10
 #################################################
11 11
 
12
+add_subdirectory( tests )
13
+
12 14
 include_directories(
13 15
   ${TQT_INCLUDE_DIRS}
14 16
   ${CMAKE_CURRENT_BINARY_DIR}

+ 40
- 0
tdeio/tdefile/tests/CMakeLists.txt View File

@@ -0,0 +1,40 @@
1
+#################################################
2
+#
3
+#  (C) 2016 Alexander Golubev
4
+#  fatzer2 (AT) gmail.com
5
+#
6
+#  Improvements and feedback are welcome
7
+#
8
+#  This file is released under GPL >= 2
9
+#
10
+#################################################
11
+
12
+include_directories(
13
+  ${TQT_INCLUDE_DIRS}
14
+  ${CMAKE_CURRENT_BINARY_DIR}
15
+  ${CMAKE_CURRENT_SOURCE_DIR}
16
+  ${CMAKE_SOURCE_DIR}/dcop
17
+  ${CMAKE_BINARY_DIR}/tdecore
18
+  ${CMAKE_SOURCE_DIR}/tdecore
19
+  ${CMAKE_SOURCE_DIR}/tdeui
20
+  ${CMAKE_SOURCE_DIR}/tdeio
21
+  ${CMAKE_SOURCE_DIR}/tdeio/tdefile
22
+  ${CMAKE_SOURCE_DIR}/tdeio/tdeio
23
+  ${CMAKE_BINARY_DIR}/tdeio/tdefile
24
+)
25
+
26
+link_directories(
27
+  ${TDECORE_LIBRARY_DIRS}
28
+)
29
+
30
+tde_add_check_executable( kurlrequestertest     LINK tdeio-shared )
31
+tde_add_check_executable( kopenwithtest         LINK tdeio-shared )
32
+tde_add_check_executable( kdirselectdialogtest  LINK tdeio-shared )
33
+tde_add_check_executable( kicondialogtest       LINK tdeio-shared )
34
+tde_add_check_executable( kcustommenueditortest LINK tdeio-shared )
35
+tde_add_check_executable( tdefilenotifytest     LINK tdeio-shared )
36
+
37
+tde_add_check_executable( tdefiletreeviewtest   AUTOMOC LINK tdeio-shared )
38
+
39
+tde_add_check_executable( kfstest AUTOMOC
40
+    SOURCES kfstest.cpp kfdtest.cpp LINK tdeio-shared )

+ 1
- 1
tdeio/tdefile/tests/kcustommenueditortest.cpp View File

@@ -6,7 +6,7 @@
6 6
 int main(int argc, char** argv)
7 7
 {
8 8
   TDELocale::setMainCatalogue("tdelibs");
9
-  TDEApplication app(argc, argv, "KCustomMenuEditorTest");
9
+  TDEApplication app(argc, argv, "KCustomMenuEditorTest", true);
10 10
   KCustomMenuEditor editor(0);
11 11
   TDEConfig *cfg = new TDEConfig("kdesktop_custom_menu2");
12 12
   editor.load(cfg);

+ 1
- 1
tdeio/tdefile/tests/kdirselectdialogtest.cpp View File

@@ -5,7 +5,7 @@
5 5
 
6 6
 int main( int argc, char **argv )
7 7
 {
8
-    TDEApplication app(argc, argv, "kdirselectdialogtest");
8
+    TDEApplication app(argc, argv, "kdirselectdialogtest", true);
9 9
 
10 10
     KURL u = KDirSelectDialog::selectDirectory( (argc >= 1) ? argv[1] : TQString::null );
11 11
     if ( u.isValid() )

+ 1
- 1
tdeio/tdefile/tests/kfstest.cpp View File

@@ -44,7 +44,7 @@
44 44
 
45 45
 int main(int argc, char **argv)
46 46
 {
47
-    TDEApplication a(argc, argv, "kfstest");
47
+    TDEApplication a(argc, argv, "kfstest", true);
48 48
     TQString name1;
49 49
     TQStringList names;
50 50
 

+ 1
- 1
tdeio/tdefile/tests/kicondialogtest.cpp View File

@@ -3,7 +3,7 @@
3 3
 
4 4
 int main( int argc, char **argv )
5 5
 {
6
-    TDEApplication app( argc, argv, "kicondialogtest" );
6
+    TDEApplication app( argc, argv, "kicondialogtest", true );
7 7
 
8 8
 //    TDEIconDialog::getIcon(); 
9 9
 

+ 1
- 1
tdeio/tdefile/tests/kopenwithtest.cpp View File

@@ -28,7 +28,7 @@
28 28
 
29 29
 int main(int argc, char **argv)
30 30
 {
31
-    TDEApplication app(argc, argv, "kopenwithtest");
31
+    TDEApplication app(argc, argv, "kopenwithtest", true);
32 32
     KURL::List list;
33 33
 
34 34
     list += KURL("file:///tmp/testfile.txt");

+ 1
- 1
tdeio/tdefile/tests/kurlrequestertest.cpp View File

@@ -5,7 +5,7 @@
5 5
 
6 6
 int main( int argc, char **argv )
7 7
 {
8
-    TDEApplication app( argc, argv, "kurlrequestertest" );
8
+    TDEApplication app( argc, argv, "kurlrequestertest", true );
9 9
     KURL url = KURLRequesterDlg::getURL( "ftp://ftp.kde.org" );
10 10
     tqDebug( "Selected url: %s", url.url().latin1());
11 11
 

tdeio/tdefile/tests/knotifytest.cpp → tdeio/tdefile/tests/tdefilenotifytest.cpp View File

@@ -3,7 +3,7 @@
3 3
 
4 4
 int main( int argc, char **argv )
5 5
 {
6
-    TDEApplication app( argc, argv, "knotifytest" );
6
+    TDEApplication app( argc, argv, "knotifytest", true );
7 7
     KNotifyDialog *dlg = new KNotifyDialog();
8 8
     dlg->addApplicationEvents( "twin" );
9 9
     return dlg->exec();

+ 1
- 1
tdeio/tdefile/tests/tdefiletreeviewtest.cpp View File

@@ -134,7 +134,7 @@ void testFrame::slotSetChildCount( KFileTreeViewItem *item, int c )
134 134
 
135 135
 int main(int argc, char **argv)
136 136
 {
137
-    TDEApplication a(argc, argv, "tdefiletreeviewtest");
137
+    TDEApplication a(argc, argv, "tdefiletreeviewtest", true);
138 138
     TQString name1;
139 139
     TQStringList names;
140 140
 

+ 1
- 1
tdeio/tdeio/dataprotocol.cpp View File

@@ -33,7 +33,7 @@
33 33
 #  include <stdlib.h>
34 34
 #endif
35 35
 #ifdef TESTKIO
36
-#  include <iostream.h>
36
+#  include <iostream>
37 37
 #endif
38 38
 
39 39
 #if !defined(DATAKIOSLAVE) && !defined(TESTKIO)

+ 40
- 0
tdeio/tests/CMakeLists.txt View File

@@ -11,8 +11,14 @@
11 11
 
12 12
 include_directories(
13 13
   ${TQT_INCLUDE_DIRS}
14
+  ${CMAKE_BINARY_DIR}
15
+  ${CMAKE_CURRENT_BINARY_DIR}
16
+  ${CMAKE_SOURCE_DIR}/dcop
14 17
   ${CMAKE_BINARY_DIR}/tdecore
15 18
   ${CMAKE_SOURCE_DIR}/tdecore
19
+  ${CMAKE_SOURCE_DIR}/tdeui
20
+  ${CMAKE_SOURCE_DIR}/tdeio
21
+  ${CMAKE_SOURCE_DIR}/tdeio/tdefile
16 22
   ${CMAKE_SOURCE_DIR}/tdeio/tdeio
17 23
 )
18 24
 
@@ -34,3 +40,37 @@ tde_add_executable( ${target}
34 40
   LINK tdeio-shared
35 41
   DESTINATION ${BIN_INSTALL_DIR}
36 42
 )
43
+
44
+
45
+##### check and test ##############################
46
+
47
+# Force assertions to work
48
+add_definitions( -UNDEBUG )
49
+
50
+set( CHECKS
51
+  getalltest jobtest kdcopcheck kdefaultprogresstest kdirlistertest
52
+  kdirwatchtest kfiltertest kionetrctest kiopassdlgtest kmfitest kmimefromext
53
+  kmimemagictest kpropsdlgtest kprotocolinfotest kruntest kscantest kshredtest
54
+  ktartest kurifiltertest kurlcompletiontest kziptest metatest netaccesstest
55
+  previewtest speed tdeioslavetest tdesycocatest tdesycocaupdatetest
56
+)
57
+
58
+foreach( _check ${CHECKS} )
59
+  tde_add_check_executable( ${_check} AUTOMOC LINK tdeio-shared )
60
+endforeach( )
61
+
62
+# NOTE some apps here are suitable to be run as tests but not included due to
63
+#      following reasons:
64
+#  - jobtest may fail if run on an unusual system configuration
65
+#            and requires GUI
66
+#  - kprotocolinfotest tries to connect to network and requires running DCOP
67
+#  - kurifiltertest requires network access and GUI
68
+#  - tdesycocatest requires installed tdebase and GUI
69
+
70
+set( TESTS dataprotocoltest kacltest kmimetypetest )
71
+
72
+foreach( _check ${TESTS} )
73
+    tde_add_check_executable( ${_check} AUTOMOC LINK tdeio-shared TEST)
74
+endforeach( )
75
+
76
+# TODO add kdirwatchunittest

+ 3
- 1
tdeio/tests/dataprotocoltest.cpp View File

@@ -21,7 +21,9 @@
21 21
 #include <tqcstring.h>
22 22
 #include <tqstring.h>
23 23
 
24
-#include <iostream.h>
24
+#include <iostream>
25
+
26
+using namespace std;
25 27
 
26 28
 class KURL;
27 29
 

+ 1
- 1
tdeio/tests/getalltest.cpp View File

@@ -7,7 +7,7 @@
7 7
 
8 8
 int main(int argc, char *argv[])
9 9
 {
10
-   TDEApplication k(argc,argv,"getalltest",false/*noGUI*/); // KMessageBox needs KApp for makeStdCaption
10
+   TDEApplication k(argc,argv,"getalltest",false/*nostyle*/,false/*noGUI*/); // KMessageBox needs KApp for makeStdCaption
11 11
 
12 12
 //for (int i = 0 ; i < 2 ; ++i ) { // test twice to see if they got deleted
13 13
    kdDebug() << "All services" << endl;

+ 1
- 1
tdeio/tests/jobtest.cpp View File

@@ -200,7 +200,7 @@ void JobTest::get()
200 200
     kapp->eventLoop()->enterLoop();
201 201
     assert( m_result == 0 ); // no error
202 202
     assert( m_data.size() == 11 );
203
-    assert( TQCString( m_data ) == "Hello world" );
203
+    assert( memcmp (m_data, "Hello world", m_data.size()) == 0 ); // m_data is not null-terminated
204 204
 }
205 205
 
206 206
 void JobTest::slotGetResult( TDEIO::Job* job )

+ 1
- 1
tdeio/tests/kacltest.cpp View File

@@ -69,7 +69,7 @@ int main(int argc, char *argv[])
69 69
 {
70 70
     TDEApplication::disableAutoDcopRegistration();
71 71
     TDECmdLineArgs::init(argc,argv,"kacltest", 0, 0, 0, 0);
72
-    TDEApplication app;
72
+    TDEApplication app(/*styles=*/false, /*gui=*/false);
73 73
 
74 74
     KACLTest test;
75 75
     test.setup();

+ 3
- 3
tdeio/tests/kdcopcheck.cpp View File

@@ -90,14 +90,14 @@ int TestService::exec()
90 90
 
91 91
 int main(int argc, char *argv[])
92 92
 {
93
-   putenv("IGNORE_SYCOCA_VERSION=true");
94
-   TDEApplication k(argc,argv,"whatever",false/*noGUI*/); // KMessageBox needs KApp for makeStdCaption
93
+   setenv("IGNORE_SYCOCA_VERSION", "true", true);
94
+   TDEApplication k(argc,argv,"whatever",false/*nostyle*/,false/*noGUI*/); // KMessageBox needs KApp for makeStdCaption
95 95
 
96 96
    k.dcopClient()->setNotifications(true);
97 97
 
98 98
    KService::List list = KService::allServices();
99 99
 
100
-   tqWarning("I found %d services.", list.count());
100
+   tqWarning("I found %ld services.", list.count());
101 101
    int i = 0;
102 102
    for(KService::List::ConstIterator it = list.begin(); it != list.end(); ++it)
103 103
    {

+ 1
- 1
tdeio/tests/kdefaultprogresstest.cpp View File

@@ -7,7 +7,7 @@ using namespace TDEIO;
7 7
 
8 8
 int main(int argc, char **argv)
9 9
 {
10
-    TDEApplication app(argc, argv, "kdefaultprogresstest");
10
+    TDEApplication app(argc, argv, "kdefaultprogresstest",true,true);
11 11
 
12 12
     DefaultProgress* dlg = new DefaultProgress();
13 13
     KURL src("http://this.host.doesn't.exist/this/dir/neither/andthisfileneither");

+ 1
- 1
tdeio/tests/kdirlistertest.cpp View File

@@ -151,7 +151,7 @@ void KDirListerTest::completed()
151 151
 
152 152
 int main ( int argc, char *argv[] )
153 153
 {
154
-  TDEApplication app( argc, argv, "kdirlistertest" );
154
+  TDEApplication app( argc, argv, "kdirlistertest", true /*styles*/ );
155 155
 
156 156
   KDirListerTest *test = new KDirListerTest( 0 );
157 157
   test->show();

+ 13
- 8
tdeio/tests/kmimetypetest.cpp View File

@@ -36,6 +36,17 @@ static void checkIcon( const KURL& url, const TQString& expectedIcon )
36 36
   }
37 37
 }
38 38
 
39
+static void checkExtention( const TQString& fileName, const TQString& expectedExtention ) {
40
+  TQString ext;
41
+  KMimeType::diagnoseFileName(fileName, ext);
42
+  if ( ext == expectedExtention) {
43
+    tqDebug("extension of %s is '%s: OK'", fileName.latin1(), ext.latin1());
44
+  } else {
45
+    tqDebug("extension of %s is '%s, expected %s!'", fileName.latin1(), ext.latin1(), expectedExtention.latin1());
46
+    exit(1);
47
+  }
48
+}
49
+
39 50
 int main( int argc, char** argv )
40 51
 {
41 52
   TDEInstance blah("kmimetypetest");
@@ -63,14 +74,8 @@ int main( int argc, char** argv )
63 74
     checkIcon( "trash:/foo/", "folder" );
64 75
   }
65 76
 
66
-  TQString pdf;
67
-  KMimeType::diagnoseFileName("foo.pdf", pdf);
68
-  tqDebug("extension: '%s'", pdf.latin1());
69
-  assert(pdf == TQString("*.pdf"));
70
-  TQString ps;
71
-  KMimeType::diagnoseFileName("foo.ps", ps);
72
-  tqDebug("extension: '%s'", ps.latin1());
73
-  assert(ps == TQString("*.ps"));
77
+  checkExtention(TQString::fromLatin1("foo.pdf"), TQString::fromLatin1("*.pdf"));
78
+  checkExtention(TQString::fromLatin1("foo.ps"), TQString::fromLatin1("*.ps"));
74 79
 
75 80
   return 0;
76 81
 }

+ 1
- 1
tdeio/tests/kprotocolinfotest.cpp View File

@@ -30,7 +30,7 @@ int main(int argc, char **argv) {
30 30
                         "1.0");
31 31
 
32 32
     TDECmdLineArgs::init(argc, argv, &aboutData);
33
-    TDEApplication app;
33
+    TDEApplication app(/*styles=*/false, /*gui=*/false);
34 34
 
35 35
     KURL url;
36 36
     url.setPath("/tmp");

+ 8
- 8
tdeio/tests/kruntest.cpp View File

@@ -121,7 +121,7 @@ void checkPDE(const KService &service, const KURL::List &urls, bool hs, bool tf,
121 121
 
122 122
 int main(int argc, char **argv)
123 123
 {
124
-  TDEApplication app( argc, argv, "kruntest", true /* it _has_ a GUI ! */);
124
+  TDEApplication app( argc, argv, "kruntest", true /*styles*/, true /* it _has_ a GUI ! */);
125 125
 
126 126
   // First some non-interactive tests
127 127
   checkBN( "/usr/bin/ls", true, "ls");
@@ -164,16 +164,16 @@ int main(int argc, char **argv)
164 164
       for (int te = 0; te < 2; te++)
165 165
         for (int ex = 0; ex < 2; ex++) {
166 166
           int fd = creat("kruntest.desktop", 0666);
167
-	  FILE *f;
167
+          FILE *f;
168 168
           if (fd < 0) abort();
169
-	  f = KDE_fdopen(fd, "w");
169
+          f = KDE_fdopen(fd, "w");
170 170
           fprintf(f, "[Desktop Entry]\n"
171
-		"Type=Application\n"
172
-		"Name=just_a_test\n"
173
-		"Icon=~/icon.png\n"
174
-		"%s\n%s\n%s\n",execs[ex],terms[te],sus[su]);
171
+            "Type=Application\n"
172
+            "Name=just_a_test\n"
173
+            "Icon=~/icon.png\n"
174
+            "%s\n%s\n%s\n",execs[ex],terms[te],sus[su]);
175 175
           close(fd);
176
-	  fclose(f);
176
+          fclose(f);
177 177
           KService s(TQDir::currentDirPath() + "/kruntest.desktop");
178 178
           unlink("kruntest.desktop");
179 179
           checkPDE( s, l0, hs, false, rslts[ex+te*2+su*4+hs*8]);

+ 2
- 2
tdeio/tests/kscantest.cpp View File

@@ -3,11 +3,11 @@
3 3
 
4 4
 int main( int argc, char **argv )
5 5
 {
6
-    TDEApplication app( argc, argv, "kscantest" );
6
+    TDEApplication app( argc, argv, "kscantest", true, true );
7 7
     KScanDialog *dlg = KScanDialog::getScanDialog();
8 8
     if ( !dlg ) {
9 9
 	tqDebug("*** EEK, no Scan-service available, aborting!");
10
-	return 0;
10
+	return EXIT_FAILURE;
11 11
     }
12 12
     
13 13
     dlg->show();

+ 9
- 5
tdeio/tests/kurifiltertest.cpp View File

@@ -155,14 +155,14 @@ int main(int argc, char **argv)
155 155
 {
156 156
     // Ensure that user configuration doesn't change the results of those tests
157 157
     // TDEHOME needs to be writable though, for a tdesycoca database
158
-    setenv( "TDEHOME", TQFile::encodeName( TQDir::homeDirPath() + "/.tde-kurifiltertest" ), true );
158
+    setenv( "TDEHOME", TQFile::encodeName( TQDir::currentDirPath() + "/.tde-kurifiltertest" ), true );
159 159
     setenv( "TDE_FORK_SLAVES", "yes", true ); // simpler, for the final cleanup
160 160
 
161 161
     TDEAboutData aboutData(appName, programName, version, description);
162 162
     TDECmdLineArgs::init(argc, argv, &aboutData);
163 163
     TDECmdLineArgs::addCmdLineOptions( options );
164 164
 
165
-    TDEApplication app;
165
+    TDEApplication app; // it _is_ GUI app
166 166
     app.disableAutoDcopRegistration();
167 167
 
168 168
     // Allow testing of the search engine using both delimiters...
@@ -294,7 +294,9 @@ int main(int argc, char **argv)
294 294
 
295 295
     filter( "$SOMEVAR/tdelibs/tdeio", 0, KURIFilterData::ERROR ); // note: this dir doesn't exist...
296 296
     filter( "$ETC/passwd", "/etc/passwd", KURIFilterData::LOCAL_FILE );
297
-    filter( "$QTDIR/doc/html/functions.html#s", TQCString("file://")+qtdir+"/doc/html/functions.html#s", KURIFilterData::LOCAL_FILE );
297
+    if( !qtdir.isEmpty() ) {
298
+        filter( "$QTDIR/doc/html/functions.html#s", TQCString("file://")+qtdir+"/doc/html/functions.html#s", KURIFilterData::LOCAL_FILE );
299
+    }
298 300
     filter( "http://www.kde.org/$USER", "http://www.kde.org/$USER", KURIFilterData::NET_PROTOCOL ); // no expansion
299 301
 
300 302
     // Assume the default (~/.trinity) if
@@ -333,13 +335,15 @@ int main(int argc, char **argv)
333 335
     // the shortURI filter will return the string
334 336
     // itself if the requested environment variable
335 337
     // is not already set.
336
-    filter( "$QTDIR", 0, KURIFilterData::LOCAL_DIR, "tdeshorturifilter" ); //use specific filter.
338
+    if( !qtdir.isEmpty() ) {
339
+        filter( "$QTDIR", 0, KURIFilterData::LOCAL_DIR, "tdeshorturifilter" ); //use specific filter.
340
+    }
337 341
     filter( "$HOME", home, KURIFilterData::LOCAL_DIR, "tdeshorturifilter" ); //use specific filter.
338 342
 
339 343
 
340 344
     TQCString sc;
341 345
     filter( sc.sprintf("gg%cfoo bar",delimiter), "http://www.google.com/search?q=foo+bar&ie=UTF-8&oe=UTF-8", KURIFilterData::NET_PROTOCOL );
342
-    filter( sc.sprintf("bug%c55798", delimiter), "http://bugs.kde.org/show_bug.cgi?id=55798", KURIFilterData::NET_PROTOCOL );
346
+    filter( sc.sprintf("bug%c55798", delimiter), "http://bugs.pearsoncomputing.net/show_bug.cgi?id=55798", KURIFilterData::NET_PROTOCOL );
343 347
 
344 348
     filter( sc.sprintf("gg%cC++", delimiter), "http://www.google.com/search?q=C%2B%2B&ie=UTF-8&oe=UTF-8", KURIFilterData::NET_PROTOCOL );
345 349
     filter( sc.sprintf("ya%cfoo bar was here", delimiter), 0, -1 ); // this triggers default search, i.e. google

+ 1
- 1
tdeio/tests/kurlcompletiontest.cpp View File

@@ -166,7 +166,7 @@ int main( int argc, char **argv )
166 166
 {
167 167
     TDEApplication::disableAutoDcopRegistration();
168 168
     TDECmdLineArgs::init(argc,argv,"kurlcompletiontest", 0, 0, 0, 0);
169
-    TDEApplication app;
169
+    TDEApplication app(/*styles=*/false, /*gui=*/false);
170 170
 
171 171
     {
172 172
         KURLCompletionTest test;

+ 1
- 1
tdeio/tests/netaccesstest.cpp View File

@@ -24,7 +24,7 @@
24 24
 
25 25
 int main(int argc, char **argv)
26 26
 {
27
-  TDEApplication app( argc, argv, "netaccesstest", true /* it _has_ a GUI ! */);
27
+  TDEApplication app( argc, argv, "netaccesstest", true /*styles*/, true /* it _has_ a GUI ! */);
28 28
 
29 29
   KURL srcURL( "ftp://ftp.kde.org/pub/kde/README" );
30 30
   KURL tmpURL( "file:/tmp/netaccesstest_README" );

+ 1
- 1
tdeio/tests/previewtest.cpp View File

@@ -55,7 +55,7 @@ void PreviewTest::slotFailed()
55 55
 
56 56
 int main(int argc, char **argv)
57 57
 {
58
-    TDEApplication app(argc, argv, "previewtest");
58
+    TDEApplication app(argc, argv, "previewtest", true, true);
59 59
     PreviewTest *w = new PreviewTest;
60 60
     w->show();
61 61
     app.setMainWidget(w);

+ 1
- 1
tdeio/tests/tdeioslavetest.cpp View File

@@ -452,7 +452,7 @@ void KioslaveTest::slotDataReq(TDEIO::Job*, TQByteArray &data)
452 452
          "Hello world\n",
453 453
          "This is a test file\n",
454 454
          "You can safely delete it.\n",
455
-	 "BIG\n",
455
+         "BIG\n",
456 456
          0
457 457
        };
458 458
     const char *fileData = fileDataArray[putBuffer++];

+ 3
- 3
tdeio/tests/tdesycocatest.cpp View File

@@ -43,7 +43,7 @@ bool check(TQString txt, TQString a, TQString b)
43 43
     kdDebug() << txt << " : checking '" << a << "' against expected value '" << b << "'... " << "ok" << endl;
44 44
   }
45 45
   else {
46
-    kdDebug() << txt << " : checking '" << a << "' against expected value '" << b << "'... " << "KO !" << endl
46
+    kdError() << txt << " : checking '" << a << "' against expected value '" << b << "'... " << "KO !" << endl
47 47
 ;
48 48
     exit(1);
49 49
   }
@@ -52,7 +52,7 @@ bool check(TQString txt, TQString a, TQString b)
52 52
 
53 53
 void debug(TQString txt)
54 54
 {
55
- fprintf(stderr, "%s\n", txt.ascii());
55
+ fprintf(stderr, "%s\n", txt.utf8().data());
56 56
 }
57 57
 
58 58
 void debug(const char *txt)
@@ -67,7 +67,7 @@ void debug(const char *format, const char *txt)
67 67
 
68 68
 int main(int argc, char *argv[])
69 69
 {
70
-   TDEApplication k(argc,argv,"whatever",false/*noGUI*/); // KMessageBox needs KApp for makeStdCaption
70
+   TDEApplication k(argc,argv,"whatever",true); // KMessageBox needs KApp for makeStdCaption
71 71
 
72 72
    TQCString instname = "kword";
73 73
    TQString desktopPath = TQString::fromLatin1( "Office/%1.desktop" ).arg( instname );

+ 1
- 1
tdeio/tests/tdesycocaupdatetest.cpp View File

@@ -4,7 +4,7 @@
4 4
 
5 5
 int main(int argc, char *argv[])
6 6
 {
7
-   TDEApplication k(argc,argv,"whatever"); // KMessageBox needs KApp for makeStdCaption
7
+   TDEApplication k(argc,argv,"whatever",true,true); // KMessageBox needs KApp for makeStdCaption
8 8
 
9 9
    KService::rebuildKSycoca(0);
10 10
    return 0;

Loading…
Cancel
Save