diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2014-07-21 16:36:24 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2014-07-23 17:50:23 +0200 |
commit | cfaf851e268dac95cb140fbffc1233981ce48d4c (patch) | |
tree | 0a8ae098f6636fa301c48c3c17a4e9fefdb1e184 /tests/auto/corelib/plugin/qlibrary | |
parent | 800d0076e0adaeb751f7040fbd7476292e1a2af9 (diff) |
Fix a few more race conditions with QLibrary::LoadHints
This commit makes replaces the loadHints member with a setter, a getter
and an atomic variable. The setter will not set anything if the library
has already been loaded.
Task-number: QTBUG-39642
Change-Id: Ibb7692f16d80211b52aaf4dc88db1a989738a24d
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'tests/auto/corelib/plugin/qlibrary')
-rw-r--r-- | tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp index d60e1514b9..fc7e99103c 100644 --- a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp +++ b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp @@ -460,6 +460,14 @@ void tst_QLibrary::loadHints() library.setFileName(lib); QCOMPARE(library.loadHints(), lh); bool ok = library.load(); + + // we can't change the hints anymore + library.setLoadHints(QLibrary::LoadHints()); + QCOMPARE(library.loadHints(), lh); + + // confirm that a new QLibrary inherits the hints too + QCOMPARE(QLibrary(lib).loadHints(), lh); + if ( result ) { QVERIFY( ok ); QVERIFY(library.unload()); |