diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-09-27 19:53:01 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-29 06:41:42 +0200 |
commit | 95cebd34ebc5b4d39b11dc91610309a35e488663 (patch) | |
tree | 90ceffef5acea093dd2b8f8f7e8c30593023b85a /tests/auto/corelib/plugin/qlibrary | |
parent | ab061e3e436fab35eac8666f3e950e98f66c4d3e (diff) |
Remove Symbian-specific code from tests.
Symbian is not a supported platform for Qt5, so this code is no longer
required.
Change-Id: I1172e6a42d518490e63e9599bf10579df08259aa
Reviewed-on: http://codereview.qt-project.org/5657
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/corelib/plugin/qlibrary')
-rw-r--r-- | tests/auto/corelib/plugin/qlibrary/lib/lib.pro | 3 | ||||
-rw-r--r-- | tests/auto/corelib/plugin/qlibrary/lib/mylib.c | 2 | ||||
-rw-r--r-- | tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro | 45 | ||||
-rw-r--r-- | tests/auto/corelib/plugin/qlibrary/lib2/mylib.c | 2 | ||||
-rw-r--r-- | tests/auto/corelib/plugin/qlibrary/qlibrary.pro | 6 | ||||
-rw-r--r-- | tests/auto/corelib/plugin/qlibrary/tst/tst.pro | 11 | ||||
-rw-r--r-- | tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp | 59 |
7 files changed, 22 insertions, 106 deletions
diff --git a/tests/auto/corelib/plugin/qlibrary/lib/lib.pro b/tests/auto/corelib/plugin/qlibrary/lib/lib.pro index 6d80881cd2..f95e6338e0 100644 --- a/tests/auto/corelib/plugin/qlibrary/lib/lib.pro +++ b/tests/auto/corelib/plugin/qlibrary/lib/lib.pro @@ -12,6 +12,3 @@ win32-borland: DEFINES += WIN32_BORLAND #no special install rule for the library used by test INSTALLS = - -symbian: TARGET.CAPABILITY=ALL -TCB - diff --git a/tests/auto/corelib/plugin/qlibrary/lib/mylib.c b/tests/auto/corelib/plugin/qlibrary/lib/mylib.c index f1a2b7a002..b9d3c1b219 100644 --- a/tests/auto/corelib/plugin/qlibrary/lib/mylib.c +++ b/tests/auto/corelib/plugin/qlibrary/lib/mylib.c @@ -41,7 +41,7 @@ #include <qglobal.h> -#if defined(Q_CC_MSVC) || defined(Q_CC_MSVC_NET) || defined(Q_CC_BOR) || defined(Q_OS_SYMBIAN) +#if defined(Q_CC_MSVC) || defined(Q_CC_MSVC_NET) || defined(Q_CC_BOR) #define LIB_EXPORT __declspec(dllexport) #else #define LIB_EXPORT diff --git a/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro b/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro index b441569e5a..835240af22 100644 --- a/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro +++ b/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro @@ -14,42 +14,23 @@ win32-borland: DEFINES += WIN32_BORLAND # Force a copy of the library to have an extension that is non-standard. # We want to test if we can load a shared library with *any* filename... -!symbian { - win32 { - # vcproj and Makefile generators refer to target differently - contains(TEMPLATE,vc.*) { - src = $(TargetPath) - } else { - src = $(DESTDIR_TARGET) - } - files = mylib.dl2 system.trolltech.test.mylib.dll +win32 { + # vcproj and Makefile generators refer to target differently + contains(TEMPLATE,vc.*) { + src = $(TargetPath) } else { - src = $(DESTDIR)$(TARGET) - files = libmylib.so2 system.trolltech.test.mylib.so + src = $(DESTDIR_TARGET) } - for(file, files) { - QMAKE_POST_LINK += $$QMAKE_COPY $$src ..$$QMAKE_DIR_SEP$$file && - CLEAN_FILES += ../$$file - } - QMAKE_POST_LINK = $$member(QMAKE_POST_LINK, 0, -2) -} - -symbian-abld: { - TARGET.CAPABILITY=ALL -TCB - FIXEDROOT = $$replace(EPOCROOT,/,\\) - QMAKE_POST_LINK = \ - copy /Y $${FIXEDROOT}epoc32\\release\\$(PLATFORM)\\$(CFG)\\mylib.dll $${FIXEDROOT}epoc32\\release\\$(PLATFORM)\\$(CFG)\\mylib.dl2 && \ - copy /Y $${FIXEDROOT}epoc32\\release\\$(PLATFORM)\\$(CFG)\\mylib.dll $${FIXEDROOT}epoc32\\release\\$(PLATFORM)\\$(CFG)\\system.trolltech.test.mylib.dll && \ - IF NOT "$(PLATFORM)==WINSCW" copy /Y $${FIXEDROOT}epoc32\\release\\$(PLATFORM)\\$(CFG)\\mylib.dll ..\\tst\\mylib.dl2 + files = mylib.dl2 system.trolltech.test.mylib.dll +} else { + src = $(DESTDIR)$(TARGET) + files = libmylib.so2 system.trolltech.test.mylib.so } - -symbian-sbsv2: { - TARGET.CAPABILITY=ALL -TCB - QMAKE_POST_LINK = \ - $(GNUCP) $(EPOCROOT)epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/mylib.dll $(EPOCROOT)epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/mylib.dl2 && \ - $(GNUCP) $(EPOCROOT)epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/mylib.dll $(EPOCROOT)epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/system.trolltech.test.mylib.dll && \ - if test $(PLATFORM) != WINSCW;then $(GNUCP) $(EPOCROOT)epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/mylib.dll $${PWD}/../tst/mylib.dl2; fi +for(file, files) { + QMAKE_POST_LINK += $$QMAKE_COPY $$src ..$$QMAKE_DIR_SEP$$file && + CLEAN_FILES += ../$$file } +QMAKE_POST_LINK = $$member(QMAKE_POST_LINK, 0, -2) #no special install rule for the library used by test INSTALLS = diff --git a/tests/auto/corelib/plugin/qlibrary/lib2/mylib.c b/tests/auto/corelib/plugin/qlibrary/lib2/mylib.c index f824a3a82d..950102abcc 100644 --- a/tests/auto/corelib/plugin/qlibrary/lib2/mylib.c +++ b/tests/auto/corelib/plugin/qlibrary/lib2/mylib.c @@ -41,7 +41,7 @@ #include <qglobal.h> -#if defined(Q_CC_MSVC) || defined(Q_CC_MSVC_NET) || defined(Q_CC_BOR)|| defined(Q_OS_SYMBIAN) +#if defined(Q_CC_MSVC) || defined(Q_CC_MSVC_NET) || defined(Q_CC_BOR) #define LIB_EXPORT __declspec(dllexport) #else #define LIB_EXPORT diff --git a/tests/auto/corelib/plugin/qlibrary/qlibrary.pro b/tests/auto/corelib/plugin/qlibrary/qlibrary.pro index 5dc129fbf9..49c29d7edc 100644 --- a/tests/auto/corelib/plugin/qlibrary/qlibrary.pro +++ b/tests/auto/corelib/plugin/qlibrary/qlibrary.pro @@ -2,15 +2,9 @@ QT -= gui TEMPLATE = subdirs CONFIG += ordered -symbian: { -# Can't build two versions of lib with same name in symbian, so just build one -SUBDIRS = lib2 \ - tst -} else { SUBDIRS = lib \ lib2 \ tst -} TARGET = tst_qlibrary # no special install rule for subdir diff --git a/tests/auto/corelib/plugin/qlibrary/tst/tst.pro b/tests/auto/corelib/plugin/qlibrary/tst/tst.pro index 28c40b0b42..76fd196745 100644 --- a/tests/auto/corelib/plugin/qlibrary/tst/tst.pro +++ b/tests/auto/corelib/plugin/qlibrary/tst/tst.pro @@ -16,17 +16,6 @@ wince*: { addFiles.path = . DEPLOYMENT += addFiles DEFINES += SRCDIR=\\\"\\\" -}else:symbian { - binDep.files = \ - mylib.dll \ - system.trolltech.test.mylib.dll - binDep.path = /sys/bin -#mylib.dl2 nonstandard binary deployment will cause warning in emulator, -#but it can be safely ignored. - custBinDep.files = mylib.dl2 - custBinDep.path = /sys/bin - - DEPLOYMENT += binDep custBinDep } else { DEFINES += SRCDIR=\\\"$$PWD/../\\\" } diff --git a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp index 675d0e6ab6..0311cce4f8 100644 --- a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp +++ b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp @@ -86,7 +86,7 @@ # define SUFFIX ".a" # define PREFIX "lib" -#elif defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) +#elif defined(Q_OS_WIN) # undef dll_VALID # define dll_VALID true # undef DLL_VALID @@ -103,12 +103,8 @@ static QString sys_qualifiedLibraryName(const QString &fileName) { -#if defined(Q_OS_SYMBIAN) - return PREFIX + fileName + SUFFIX; -#else QString currDir = QDir::currentPath(); return currDir + "/" + PREFIX + fileName + SUFFIX; -#endif } //TESTED_CLASS= @@ -194,7 +190,7 @@ void tst_QLibrary::version() QFETCH( int, loadversion ); QFETCH( int, resultversion ); -#if !defined(Q_OS_AIX) && !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN) +#if !defined(Q_OS_AIX) && !defined(Q_OS_WIN) QString currDir = QDir::currentPath(); QLibrary library( currDir + QLatin1Char('/') + lib, loadversion ); bool ok = library.load(); @@ -217,11 +213,8 @@ void tst_QLibrary::load_data() QTest::addColumn<QString>("lib"); QTest::addColumn<bool>("result"); -#if defined(Q_OS_SYMBIAN) - QString currDir; -#else QString currDir = QDir::currentPath(); -#endif + QTest::newRow( "ok00" ) << currDir + "/mylib" << true; QTest::newRow( "notexist" ) << currDir + "/nolib" << false; QTest::newRow( "badlibrary" ) << currDir + "/qlibrary.pro" << false; @@ -230,7 +223,7 @@ void tst_QLibrary::load_data() QTest::newRow("ok (libmylib ver. 1)") << currDir + "/libmylib" <<true; #endif -# if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) +# if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) QTest::newRow( "ok01 (with suffix)" ) << currDir + "/mylib.dll" << true; QTest::newRow( "ok02 (with non-standard suffix)" ) << currDir + "/mylib.dl2" << true; QTest::newRow( "ok03 (with many dots)" ) << currDir + "/system.trolltech.test.mylib.dll" << true; @@ -261,11 +254,7 @@ void tst_QLibrary::unload_data() QTest::addColumn<QString>("lib"); QTest::addColumn<bool>("result"); -#if defined(Q_OS_SYMBIAN) - QString currDir; -#else QString currDir = QDir::currentPath(); -#endif QTest::newRow( "mylib" ) << currDir + "/mylib" << true; #ifdef Q_WS_MAC @@ -292,17 +281,12 @@ void tst_QLibrary::unload() void tst_QLibrary::unload_after_implicit_load() { -#if defined(Q_OS_SYMBIAN) - QSKIP("SYMBIAN does not support symbols on non-STDDLL libraries.", SkipAll); -#endif - QLibrary library( "./mylib" ); QFunctionPointer p = library.resolve("mylibversion"); QVERIFY(p); // Check if it was loaded QVERIFY(library.isLoaded()); QVERIFY(library.unload()); QCOMPARE(library.isLoaded(), false); - } void tst_QLibrary::resolve_data() @@ -311,11 +295,7 @@ void tst_QLibrary::resolve_data() QTest::addColumn<QString>("symbol"); QTest::addColumn<bool>("goodPointer"); -#if defined(Q_OS_SYMBIAN) - QString currDir; -#else QString currDir = QDir::currentPath(); -#endif QTest::newRow( "ok00" ) << currDir + "/mylib" << QString("mylibversion") << true; QTest::newRow( "bad00" ) << currDir + "/mylib" << QString("nosym") << false; @@ -324,10 +304,6 @@ void tst_QLibrary::resolve_data() void tst_QLibrary::resolve() { -#if defined(Q_OS_SYMBIAN) - QSKIP("SYMBIAN does not support symbols on non-STDDLL libraries.", SkipAll); -#endif - typedef int (*testFunc)(); QFETCH( QString, lib ); QFETCH( QString, symbol ); @@ -380,7 +356,7 @@ void tst_QLibrary::isLibrary_data() QTest::newRow("good (libmylib.so.1.0.0)") << QString("libmylib.so.1.0.0") << true; QTest::newRow("bad (libmylib.1.0.0.foo)") << QString("libmylib.1.0.0.foo") << false; -#elif defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) +#elif defined(Q_OS_WIN) QTest::newRow("good (with many dots)" ) << "/system.trolltech.test.mylib.dll" << true; #endif } @@ -400,15 +376,11 @@ void tst_QLibrary::errorString_data() QTest::addColumn<bool>("success"); QTest::addColumn<QString>("errorString"); -#if defined(Q_OS_SYMBIAN) - QString currDir; -#else QString currDir = QDir::currentPath(); QString srcDir = SRCDIR; if (srcDir.isEmpty()) srcDir = currDir; -#endif QTest::newRow("bad load()") << (int)Load << QString("nosuchlib") << false << QString("Cannot load library nosuchlib: .*"); QTest::newRow("call errorString() on QLibrary with no d-pointer (crashtest)") << (int)(Load | DontSetFileName) << QString() << false << QString("Unknown error"); @@ -423,8 +395,6 @@ void tst_QLibrary::errorString_data() QTest::newRow("bad load() with .dll suffix") << (int)Load << QString("nosuchlib.dll") << false << QString("Cannot load library nosuchlib.dll: The specified module could not be found."); // QTest::newRow("bad unload") << (int)Unload << QString("nosuchlib.dll") << false << QString("QLibrary::unload_sys: Cannot unload nosuchlib.dll (The specified module could not be found.)"); #elif defined Q_OS_MAC -#elif defined Q_OS_SYMBIAN - QTest::newRow("load invalid file") << (int)Load << "tst_qlibrary.exe" << false << QString("Cannot load library.*"); #else QTest::newRow("load invalid file") << (int)Load << srcDir + "/library_path/invalid.so" << false << QString("Cannot load library.*"); #endif @@ -437,13 +407,6 @@ void tst_QLibrary::errorString() QFETCH(bool, success); QFETCH(QString, errorString); -#if defined(Q_OS_SYMBIAN) - if ( success ) - { - QSKIP("SYMBIAN does not support symbols on non-STDDLL libraries.", SkipSingle ); - } -#endif - QLibrary lib; if (!(operation & DontSetFileName)) { lib.setFileName(fileName); @@ -495,14 +458,10 @@ void tst_QLibrary::loadHints_data() } #endif -#if defined(Q_OS_SYMBIAN) - QString currDir; -#else QString currDir = QDir::currentPath(); -#endif lh |= QLibrary::ResolveAllSymbolsHint; -# if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) +# if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) QTest::newRow( "ok01 (with suffix)" ) << currDir + "/mylib.dll" << int(lh) << true; QTest::newRow( "ok02 (with non-standard suffix)" ) << currDir + "/mylib.dl2" << int(lh) << true; QTest::newRow( "ok03 (with many dots)" ) << currDir + "/system.trolltech.test.mylib.dll" << int(lh) << true; @@ -566,7 +525,7 @@ void tst_QLibrary::fileName() } QVERIFY(ok); -#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) +#if defined(Q_OS_WIN) QCOMPARE(lib.fileName().toLower(), expectedFilename.toLower()); #else QCOMPARE(lib.fileName(), expectedFilename); @@ -577,11 +536,7 @@ void tst_QLibrary::fileName() void tst_QLibrary::multipleInstancesForOneLibrary() { -#if defined(Q_OS_SYMBIAN) - QString lib = "/mylib"; -#else QString lib = QDir::currentPath() + "/mylib"; -#endif { QLibrary lib1(lib); |