diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-10-20 09:22:31 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-10-20 13:25:27 +0200 |
commit | b6c21248de87f892c3711a248a0514d3c3f73200 (patch) | |
tree | aa5b7fc23bf74ee3455c8d360ea67ea79bff6702 /sources | |
parent | 1abfef23f6b21e073472463840a9979cf3f46712 (diff) |
shiboken2: Fix testnumericaltypedef failing with Qt 6
The test uses "ushort" as a type name, which is apparently
pulled from some header with increased language level.
Use a real custom name to circumvent this.
Change-Id: I6f3ba16d8f25f5b12edcfd53b1397de9f7c1d583
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources')
-rw-r--r-- | sources/shiboken2/ApiExtractor/tests/testnumericaltypedef.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sources/shiboken2/ApiExtractor/tests/testnumericaltypedef.cpp b/sources/shiboken2/ApiExtractor/tests/testnumericaltypedef.cpp index 4f0b0e10f..193bd8051 100644 --- a/sources/shiboken2/ApiExtractor/tests/testnumericaltypedef.cpp +++ b/sources/shiboken2/ApiExtractor/tests/testnumericaltypedef.cpp @@ -76,16 +76,16 @@ void TestNumericalTypedef::testNumericalTypedef() void TestNumericalTypedef::testUnsignedNumericalTypedef() { const char* cppCode ="\ - typedef unsigned short ushort;\n\ + typedef unsigned short custom_ushort;\n\ void funcUnsignedShort(unsigned short);\n\ - void funcUShort(ushort);\n"; + void funcUShort(custom_ushort);\n"; const char* xmlCode = "\ <typesystem package='Foo'>\n\ <primitive-type name='short'/>\n\ <primitive-type name='unsigned short'/>\n\ - <primitive-type name='ushort'/>\n\ + <primitive-type name='custom_ushort'/>\n\ <function signature='funcUnsignedShort(unsigned short)'/>\n\ - <function signature='funcUShort(ushort)'/>\n\ + <function signature='funcUShort(custom_ushort)'/>\n\ </typesystem>\n"; QScopedPointer<AbstractMetaBuilder> builder(TestUtil::parse(cppCode, xmlCode, false)); QVERIFY(!builder.isNull()); @@ -100,7 +100,7 @@ void TestNumericalTypedef::testUnsignedNumericalTypedef() std::swap(funcUnsignedShort, funcUShort); QCOMPARE(funcUnsignedShort->minimalSignature(), QLatin1String("funcUnsignedShort(unsigned short)")); - QCOMPARE(funcUShort->minimalSignature(), QLatin1String("funcUShort(ushort)")); + QCOMPARE(funcUShort->minimalSignature(), QLatin1String("funcUShort(custom_ushort)")); const AbstractMetaType* unsignedShortType = funcUnsignedShort->arguments().first()->type(); QVERIFY(unsignedShortType); @@ -110,7 +110,7 @@ void TestNumericalTypedef::testUnsignedNumericalTypedef() const AbstractMetaType* ushortType = funcUShort->arguments().first()->type(); QVERIFY(ushortType); - QCOMPARE(ushortType->cppSignature(), QLatin1String("ushort")); + QCOMPARE(ushortType->cppSignature(), QLatin1String("custom_ushort")); QVERIFY(ushortType->isPrimitive()); QVERIFY(ushortType->typeEntry()->isCppPrimitive()); } |