aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/tests
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2017-08-24 14:57:20 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2017-08-24 14:33:32 +0000
commit84597fa46a6c0134cef514f749c3f072bfe6fe14 (patch)
tree603bc254ae8f1c2d5509a17bd57a6572e5a3bb23 /sources/shiboken2/ApiExtractor/tests
parent9ef1e16b3325239bf782ddb893cbe2b76ab4b4d7 (diff)
Fix the chain of issues regarding QSslConfiguration
The failure was seen on Windows CI build, but was actually present on all platforms if the QSsl checks were properly fixed, or if certain CMake versions randomly decided to force C++11 usage. The first issue was that QSsl wrappers were not generated on all platforms because the C++11 standard was not forced for the compilation tests done in the check_qt_class macro. This is a bug in CMake, and the official way of fixing this is introduced in the yet unreleased CMake 3.9 version. The current fix is a workaround to explicitly pass the C++11 standard switch to the try_compile invocation. The next issue concerns handling of const char[] C++ types. There are three such members in QSslConfiguration, which caused build failures due to incorrectly generated code. The solution is to treat "const char[]" types as "const char*" types, which generates correct conversion code. Tests were also added to check for such cases. Change-Id: I874a3591dfc5f385338de7e3aff2a2c0dd2f5719 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/tests')
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testarrayargument.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/tests/testarrayargument.cpp b/sources/shiboken2/ApiExtractor/tests/testarrayargument.cpp
index 408c51461..7c9d20ede 100644
--- a/sources/shiboken2/ApiExtractor/tests/testarrayargument.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testarrayargument.cpp
@@ -71,8 +71,11 @@ void TestArrayArgument::testArraySignature()
void mi1(int arg[5]);\n\
void mi1c(const int arg[5]);\n\
void mi1cu(const int arg[]);\n\
+ void mc1cu(const char arg[]);\n\
+ void mc1cup(const char *arg[]);\n\
void muc2(unsigned char *arg[2][3]);\n\
void mc2c(const char *arg[5][6]);\n\
+ void mc2cu(const char arg[][2]);\n\
};\n";
const char xmlCode[] = "\
<typesystem package='Foo'>\n\
@@ -91,10 +94,16 @@ void TestArrayArgument::testArraySignature()
QLatin1String("mi1c(const int[5])"));
QCOMPARE(functionMinimalSignature(classA, QLatin1String("mi1cu")),
QLatin1String("mi1cu(const int[])"));
+ QCOMPARE(functionMinimalSignature(classA, QLatin1String("mc1cu")),
+ QLatin1String("mc1cu(const char*)"));
+ QCOMPARE(functionMinimalSignature(classA, QLatin1String("mc1cup")),
+ QLatin1String("mc1cup(const char*[])"));
QCOMPARE(functionMinimalSignature(classA, QLatin1String("muc2")),
QLatin1String("muc2(unsigned char*[2][3])"));
QCOMPARE(functionMinimalSignature(classA, QLatin1String("mc2c")),
QLatin1String("mc2c(const char*[5][6])"));
+ QCOMPARE(functionMinimalSignature(classA, QLatin1String("mc2cu")),
+ QLatin1String("mc2cu(const char[][2])"));
}
void TestArrayArgument::testArrayArgumentWithSizeDefinedByEnumValue()