aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/tests/testutil.h
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/ApiExtractor/tests/testutil.h')
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testutil.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/sources/shiboken2/ApiExtractor/tests/testutil.h b/sources/shiboken2/ApiExtractor/tests/testutil.h
index dea6d92d8..c6ad19d7e 100644
--- a/sources/shiboken2/ApiExtractor/tests/testutil.h
+++ b/sources/shiboken2/ApiExtractor/tests/testutil.h
@@ -40,13 +40,15 @@ namespace TestUtil
{
static AbstractMetaBuilder *parse(const char *cppCode, const char *xmlCode,
bool silent = true,
- const char *apiVersion = Q_NULLPTR,
+ const QString &apiVersion = QString(),
const QStringList &dropTypeEntries = QStringList())
{
ReportHandler::setSilent(silent);
TypeDatabase* td = TypeDatabase::instance(true);
- if (apiVersion && !td->setApiVersion(QLatin1String("*"), QLatin1String(apiVersion)))
- return Q_NULLPTR;
+ if (apiVersion.isEmpty())
+ TypeDatabase::clearApiVersions();
+ else if (!td->setApiVersion(QLatin1String("*"), apiVersion))
+ return nullptr;
td->setDropTypeEntries(dropTypeEntries);
QBuffer buffer;
// parse typesystem