diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2021-09-25 07:50:56 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2021-10-04 14:01:42 -0700 |
commit | 461084b6c483c0dc90415d4f16868e194fcd6f0a (patch) | |
tree | 5ee705532e84c01ed5b0284637bae5363d6d48d7 /tests/auto/corelib/plugin | |
parent | 349fb14c1d387e3ec052953e9f5b91b3f6b0dea7 (diff) |
Q{Elf,Mach}Parser: harmonize the arguments passed
Both functions took a QString for the input file name, but while the ELF
parser had an optional QLibrary pointer (which was never null) where to
store the error string, the Mach-O parser received a pointer to a
QString. So make both of them take a single in/out QString pointer,
which has the file name on input and is cheap for us because of COW.
Drive-by fix the name of the static function in qmachparser.cpp from
"ns" (which stood for "not suitable") to "notfound".
Change-Id: I3eb1bd30e0124f89a052fffd16a8182f4f8541c3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/corelib/plugin')
-rw-r--r-- | tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp index 839a26e3c9..53fc0b80e3 100644 --- a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp +++ b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp @@ -374,8 +374,8 @@ void tst_QPluginLoader::loadMachO() QVERIFY(f.open(QIODevice::ReadOnly)); QByteArray data = f.readAll(); - QString errorString; - QLibraryScanResult r = QMachOParser::parse(data.constData(), data.size(), f.fileName(), &errorString); + QString errorString = f.fileName(); + QLibraryScanResult r = QMachOParser::parse(data.constData(), data.size(), &errorString); QFETCH(bool, success); if (success) { @@ -397,7 +397,8 @@ void tst_QPluginLoader::loadMachO() ulong offeredlen = r.pos; do { --offeredlen; - r = QMachOParser::parse(data.constData(), offeredlen, f.fileName(), &errorString); + errorString = f.fileName(); + r = QMachOParser::parse(data.constData(), offeredlen, &errorString); QVERIFY2(r.length == 0, qPrintable(QString("Failed at size 0x%1").arg(offeredlen, 0, 16))); } while (offeredlen); #endif |