diff options
Diffstat (limited to 'libkmime/tests/test_kmime_header_parsing.cpp')
-rw-r--r-- | libkmime/tests/test_kmime_header_parsing.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/libkmime/tests/test_kmime_header_parsing.cpp b/libkmime/tests/test_kmime_header_parsing.cpp index 3839bff7e..93c447ebd 100644 --- a/libkmime/tests/test_kmime_header_parsing.cpp +++ b/libkmime/tests/test_kmime_header_parsing.cpp @@ -4,9 +4,9 @@ #include <kinstance.h> -#include <qfile.h> -#include <qcstring.h> -//#include <qstring.h> +#include <tqfile.h> +#include <tqcstring.h> +//#include <tqstring.h> //#include <stdio.h> #include <iostream> @@ -65,7 +65,7 @@ void usage( const char * msg=0 ) { exit(1); } -ostream & operator<<( ostream & stream, const QString & str ) { +ostream & operator<<( ostream & stream, const TQString & str ) { return stream << str.utf8().data(); } @@ -122,18 +122,18 @@ int main( int argc, char * argv[] ) { KInstance instance( "test_kmime_header_parsing" ); - QFile stdIn; + TQFile stdIn; stdIn.open( IO_ReadOnly, stdin ); - const QByteArray indata = stdIn.readAll(); + const TQByteArray indata = stdIn.readAll(); stdIn.close(); - QByteArray::ConstIterator iit = indata.begin(); - const QByteArray::ConstIterator iend = indata.end(); + TQByteArray::ConstIterator iit = indata.begin(); + const TQByteArray::ConstIterator iend = indata.end(); switch ( index ) { case 0: { // encoded-word - QString result; - QCString language; + TQString result; + TQCString language; // must have checked for initial '=' already: bool ok = indata.size() >= 1 && *iit++ == '=' && parseEncodedWord( iit, iend, result, language ); @@ -145,7 +145,7 @@ int main( int argc, char * argv[] ) { break; case 1: { // atom - QString result = "with 8bit: "; + TQString result = "with 8bit: "; bool ok = parseAtom( iit, iend, result, true ); cout << ( ok ? "OK" : "BAD" ) << endl @@ -165,7 +165,7 @@ int main( int argc, char * argv[] ) { break; case 2: { // token - QString result = "with 8bit: "; + TQString result = "with 8bit: "; bool ok = parseToken( iit, iend, result, true ); cout << ( ok ? "OK" : "BAD" ) << endl @@ -185,7 +185,7 @@ int main( int argc, char * argv[] ) { break; case 3: { // quoted-string - QString result; + TQString result; // must have checked for initial '"' already: bool ok = *iit++ == '"' && parseGenericQuotedString( iit, iend, result, withCRLF, '"', '"' ); @@ -196,7 +196,7 @@ int main( int argc, char * argv[] ) { break; case 4: { // domain-literal - QString result; + TQString result; // must have checked for initial '[' already: bool ok = *iit++ == '[' && parseGenericQuotedString( iit, iend, result, withCRLF, '[', ']' ); @@ -207,7 +207,7 @@ int main( int argc, char * argv[] ) { break; case 5: { // comment - QString result; + TQString result; // must have checked for initial '(' already: bool ok = *iit++ == '(' && parseComment( iit, iend, result, withCRLF, true ); @@ -218,7 +218,7 @@ int main( int argc, char * argv[] ) { break; case 6: { // phrase - QString result; + TQString result; bool ok = parsePhrase( iit, iend, result, withCRLF ); cout << ( ok ? "OK" : "BAD" ) << endl @@ -227,7 +227,7 @@ int main( int argc, char * argv[] ) { break; case 7: { // dot-atom - QString result; + TQString result; bool ok = parseDotAtom( iit, iend, result, withCRLF ); cout << ( ok ? "OK" : "BAD" ) << endl @@ -236,7 +236,7 @@ int main( int argc, char * argv[] ) { break; case 8: { // domain - QString result; + TQString result; bool ok = parseDomain( iit, iend, result, withCRLF ); cout << ( ok ? "OK" : "BAD" ) << endl @@ -245,12 +245,12 @@ int main( int argc, char * argv[] ) { break; case 9: { // obs-route - QStringList result; + TQStringList result; bool ok = parseObsRoute( iit, iend, result, withCRLF, true /*save*/ ); cout << ( ok ? "OK" : "BAD" ) << endl << "result: " << result.count() << " domains:" << endl; - for ( QStringList::ConstIterator it = result.begin() ; + for ( TQStringList::ConstIterator it = result.begin() ; it != result.end() ; ++it ) cout << (*it) << endl; } @@ -294,7 +294,7 @@ int main( int argc, char * argv[] ) { cout << ( ok ? "OK" : "BAD" ) << endl << "result.displayName:\n" << result.displayName << endl; int i = 0; - for ( QValueList<KMime::Types::Mailbox>::ConstIterator + for ( TQValueList<KMime::Types::Mailbox>::ConstIterator it = result.mailboxList.begin(); it != result.mailboxList.end() ; ++it, ++i ) cout << "result.mailboxList[" << i << "].displayName:\n" @@ -313,7 +313,7 @@ int main( int argc, char * argv[] ) { cout << ( ok ? "OK" : "BAD" ) << endl << "result.displayName:\n" << endl; int i = 0; - for ( QValueList<KMime::Types::Mailbox>::ConstIterator + for ( TQValueList<KMime::Types::Mailbox>::ConstIterator it = result.mailboxList.begin(); it != result.mailboxList.end() ; ++it, ++i ) cout << "result.mailboxList[" << i << "].displayName:\n" @@ -326,17 +326,17 @@ int main( int argc, char * argv[] ) { break; case 15: { // address-list - QValueList<KMime::Types::Address> result; + TQValueList<KMime::Types::Address> result; bool ok = parseAddressList( iit, iend, result, withCRLF ); cout << ( ok ? "OK" : "BAD" ) << endl; int j = 0; - for ( QValueList<KMime::Types::Address>::ConstIterator + for ( TQValueList<KMime::Types::Address>::ConstIterator jt = result.begin() ; jt != result.end() ; ++jt, ++j ) { cout << "result[" << j << "].displayName:\n" << (*jt).displayName << endl; int i = 0; - for ( QValueList<KMime::Types::Mailbox>::ConstIterator + for ( TQValueList<KMime::Types::Mailbox>::ConstIterator it = (*jt).mailboxList.begin(); it != (*jt).mailboxList.end() ; ++it, ++i ) cout << "result[" << j << "].mailboxList[" << i << "].displayName:\n" @@ -350,45 +350,45 @@ int main( int argc, char * argv[] ) { break; case 16: { // parameter - QPair<QString,KMime::Types::QStringOrQPair> result; + QPair<TQString,KMime::Types::QStringOrQPair> result; bool ok = parseParameter( iit, iend, result, withCRLF ); cout << ( ok ? "OK" : "BAD" ) << endl << "result.first (attribute):\n" << result.first << endl << "result.second.qstring (value):\n" << result.second.qstring << endl << "result.second.qpair (value):\n" - << QCString( result.second.qpair.first, + << TQCString( result.second.qpair.first, result.second.qpair.second+1 ).data() << endl; } break; case 17: { // raw-parameter-list - QMap<QString,KMime::Types::QStringOrQPair> result; + TQMap<TQString,KMime::Types::QStringOrQPair> result; bool ok = parseRawParameterList( iit, iend, result, withCRLF ); cout << ( ok ? "OK" : "BAD" ) << endl << "result: " << result.count() << " raw parameters:" << endl; int i = 0; - for ( QMap<QString,KMime::Types::QStringOrQPair>::ConstIterator + for ( TQMap<TQString,KMime::Types::QStringOrQPair>::ConstIterator it = result.begin() ; it != result.end() ; ++it, ++i ) cout << "result[" << i << "].key() (attribute):\n" << it.key() << endl << "result[" << i << "].data().qstring (value):\n" << it.data().qstring << endl << "result[" << i << "].data().qpair (value):\n" - << QCString( it.data().qpair.first, + << TQCString( it.data().qpair.first, it.data().qpair.second+1 ).data() << endl; } break; case 18: { // parameter-list - QMap<QString,QString> result; + TQMap<TQString,TQString> result; bool ok = parseParameterList( iit, iend, result, withCRLF ); cout << ( ok ? "OK" : "BAD" ) << endl << "result: " << result.count() << " parameters:" << endl; int i = 0; - for ( QMap<QString,QString>::Iterator it = result.begin() ; + for ( TQMap<TQString,TQString>::Iterator it = result.begin() ; it != result.end() ; ++it, ++i ) cout << "result[" << i << "].key() (attribute):\n" << it.key() << endl |