summaryrefslogtreecommitdiffstats
path: root/kdeui/tests/kaccelgentest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdeui/tests/kaccelgentest.cpp')
-rw-r--r--kdeui/tests/kaccelgentest.cpp51
1 files changed, 0 insertions, 51 deletions
diff --git a/kdeui/tests/kaccelgentest.cpp b/kdeui/tests/kaccelgentest.cpp
deleted file mode 100644
index f5f95ac57..000000000
--- a/kdeui/tests/kaccelgentest.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-#include "kaccelgen.h"
-
-#include <tqstringlist.h>
-
-#include <iostream>
-
-using std::cout;
-using std::endl;
-
-void check( const TQString &what, const TQStringList &expected, const TQStringList &received )
-{
- cout << "Testing " << what.latin1() << ": ";
- if ( expected == received ) {
- cout << "ok" << endl;
- } else {
- cout << "ERROR!" << endl;
- cout << "Expected: " << expected.join( "," ).latin1() << endl;
- cout << "Received: " << received.join( "," ).latin1() << endl;
- }
-}
-
-int main()
-{
- TQStringList input;
- input << "foo" << "bar item" << "&baz" << "bif" << "boz" << "boz 2"
- << "yoyo && dyne";
-
- TQStringList expected;
- expected << "&foo" << "bar &item" << "&baz" << "bif" << "b&oz" << "boz &2"
- << "&yoyo && dyne";
-
- TQStringList output;
- KAccelGen::generate( input, output );
- check( "TQStringList value generation", expected, output );
-
- TQMap<TQString,TQString> map;
- for (TQStringList::ConstIterator it = input.begin(); it != input.end(); ++it) {
- map.insert(*it, *it);
- }
- input.sort();
- expected.clear();
- KAccelGen::generate( input, expected );
-
- output.clear();
- KAccelGen::generateFromValues( map, output );
- check( "map value generation", expected, output );
-
- output.clear();
- KAccelGen::generateFromKeys( map, output );
- check( "map key generation", expected, output );
-}