The removal of plugin cache in qt5 (8ed47d961d)
means that only the original loading error (from QElfParser) is reported.
In Qt4 this was previously two different strings depending on if the library
had been previously cached.

Task-number: QTBUG-22834

Change-Id: I15a4adc7d0f8f23f16bb2aa8ba8b968db770f074
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This commit is contained in:
Toby Tomkins 2011-11-22 16:15:55 +10:00 committed by Qt by Nokia
parent bd3477eebc
commit ece8f9cd51

View File

@ -263,15 +263,15 @@ void tst_QPluginLoader::loadCorruptElf()
QPluginLoader lib1(SRCDIR "elftest/corrupt1.elf64.so"); QPluginLoader lib1(SRCDIR "elftest/corrupt1.elf64.so");
QCOMPARE(lib1.load(), false); QCOMPARE(lib1.load(), false);
QVERIFY2(lib1.errorString().contains("not a valid Qt plugin"), qPrintable(lib1.errorString())); QVERIFY2(lib1.errorString().contains("not an ELF object"), qPrintable(lib1.errorString()));
QPluginLoader lib2(SRCDIR "elftest/corrupt2.elf64.so"); QPluginLoader lib2(SRCDIR "elftest/corrupt2.elf64.so");
QCOMPARE(lib2.load(), false); QCOMPARE(lib2.load(), false);
QVERIFY2(lib2.errorString().contains("not a valid Qt plugin"), qPrintable(lib2.errorString())); QVERIFY2(lib2.errorString().contains("invalid"), qPrintable(lib2.errorString()));
QPluginLoader lib3(SRCDIR "elftest/corrupt3.elf64.so"); QPluginLoader lib3(SRCDIR "elftest/corrupt3.elf64.so");
QCOMPARE(lib3.load(), false); QCOMPARE(lib3.load(), false);
QVERIFY2(lib3.errorString().contains("not a valid Qt plugin"), qPrintable(lib3.errorString())); QVERIFY2(lib3.errorString().contains("invalid"), qPrintable(lib3.errorString()));
} else if (sizeof(void*) == 4) { } else if (sizeof(void*) == 4) {
QPluginLoader libW(SRCDIR "elftest/corrupt3.elf64.so"); QPluginLoader libW(SRCDIR "elftest/corrupt3.elf64.so");
QCOMPARE(libW.load(), false); QCOMPARE(libW.load(), false);