diff options
author | Darrell Anderson <humanreadable@yahoo.com> | 2013-03-02 15:57:34 -0600 |
---|---|---|
committer | Darrell Anderson <humanreadable@yahoo.com> | 2013-03-02 15:57:34 -0600 |
commit | 7c0b0c9dc9fcbe9c198925bdc7ee18ac6be49f4f (patch) | |
tree | c76702a7f6310fbe9d437e347535422e836e94e9 /tdeui/tests/kaccelgentest.cpp | |
parent | a2a38be7600e2a2c2b49c66902d912ca036a2c0f (diff) | |
parent | 27bbee9a5f9dcda53d8eb23863ee670ad1360e41 (diff) | |
download | tdelibs-7c0b0c9dc9fcbe9c198925bdc7ee18ac6be49f4f.tar.gz tdelibs-7c0b0c9dc9fcbe9c198925bdc7ee18ac6be49f4f.zip |
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tdelibs
Diffstat (limited to 'tdeui/tests/kaccelgentest.cpp')
-rw-r--r-- | tdeui/tests/kaccelgentest.cpp | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/tdeui/tests/kaccelgentest.cpp b/tdeui/tests/kaccelgentest.cpp deleted file mode 100644 index f5f95ac57..000000000 --- a/tdeui/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 ); -} |