diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-10-20 09:34:31 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-10-20 13:25:30 +0200 |
commit | a14ea7738f493280f5c7b6e4a8834a7d1daacd1e (patch) | |
tree | c2ff3d4ab084f666cda6a27e44735b17a49b147c /sources/shiboken2/ApiExtractor/tests/testcodeinjection.cpp | |
parent | b6c21248de87f892c3711a248a0514d3c3f73200 (diff) |
shiboken2/ApiExtractor tests: Avoid detaching of lists
Use constFirst/Last() instead of first()/last().
Change-Id: I3e7c72e3ab72b86565eea087b470f2a51b2999f8
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/tests/testcodeinjection.cpp')
-rw-r--r-- | sources/shiboken2/ApiExtractor/tests/testcodeinjection.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sources/shiboken2/ApiExtractor/tests/testcodeinjection.cpp b/sources/shiboken2/ApiExtractor/tests/testcodeinjection.cpp index aeca2d3f4..eed35552e 100644 --- a/sources/shiboken2/ApiExtractor/tests/testcodeinjection.cpp +++ b/sources/shiboken2/ApiExtractor/tests/testcodeinjection.cpp @@ -79,7 +79,7 @@ void TestCodeInjections::testReadFile() AbstractMetaClassList classes = builder->classes(); const AbstractMetaClass *classA = AbstractMetaClass::findClass(classes, QLatin1String("A")); QCOMPARE(classA->typeEntry()->codeSnips().count(), 1); - QString code = classA->typeEntry()->codeSnips().first().code(); + QString code = classA->typeEntry()->codeSnips().constFirst().code(); QVERIFY(code.indexOf(expected) != -1); code = classA->typeEntry()->conversionRule(); QVERIFY(code.indexOf(expected) != -1); |