Commit 7faaa3b4 authored by Adrian Page's avatar Adrian Page

- Fix the test3 test which was failing here due to it depending on the data...

- Fix the test3 test which was failing here due to it depending on the data beyond the end of the test3 string. Simplify by using QByteArray read() at the same time.
- Only test the Encrypted backend if it is available, otherwise it crashed.
- Make the success return code explicit.

svn path=/trunk/koffice/; revision=689238
parent e4c856ea
......@@ -173,10 +173,9 @@ int test( const char* testName, KoStore::Backend backend, const QString& testFil
if ( store->open( "root" ) ) {
if ( store->size() == 22 ) {
QIODevice* dev = store->device();
unsigned int i = 0;
while ( static_cast<char>( getch(dev) ) == test3[i++] );
QByteArray dataReadBack = dev->read(strlen( test3 ));
store->close();
if ( ( i - 1 ) != strlen( test3 ) )
if ( dataReadBack != QByteArray( test3 ) )
return cleanUp( store, testFile, unableToRead );
}
else {
......@@ -227,6 +226,10 @@ int main( int argc, char **argv )
return 1;
if ( test( "Zip", KoStore::Zip, "test.zip" ) != 0 )
return 1;
#ifdef QCA2
if ( test( "Encrypted", KoStore::Encrypted, "testEncrypted.zip" ) != 0 )
return 1;
#endif
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment