Commit 951ae339 authored by Volker Krause's avatar Volker Krause
Browse files

Add tests for calling JNI methods with a nullptr argument

parent 5f4b100c
......@@ -97,7 +97,10 @@ private Q_SLOTS:
QStringList l = obj.getStringList();
std::vector<QString> l2 = obj.getStringList();
QCOMPARE(obj.handle().protocol().size(), 20);
// nullptr arguments
obj.startIntent(nullptr);
QCOMPARE(obj.handle().protocol().size(), 21);
QCOMPARE(obj.handle().protocol()[0], QLatin1String("callObjectMethod: getName ()Ljava/lang/String; ()"));
QCOMPARE(obj.handle().protocol()[1], QLatin1String("callMethod: setName (Ljava/lang/String;)V (o)"));
QCOMPARE(obj.handle().protocol()[2], QLatin1String("callMethod: setName (Ljava/lang/String;)V (o)"));
......@@ -119,11 +122,13 @@ private Q_SLOTS:
QCOMPARE(obj.handle().protocol()[17], QLatin1String("callObjectMethod: getStringList ()[Ljava/lang/String; ()"));
QCOMPARE(obj.handle().protocol()[18], QLatin1String("callObjectMethod: getStringList ()[Ljava/lang/String; ()"));
QCOMPARE(obj.handle().protocol()[19], QLatin1String("callObjectMethod: getStringList ()[Ljava/lang/String; ()"));
QCOMPARE(obj.handle().protocol()[20], QLatin1String("callMethod: startIntent (Landroid/content/Intent;)V (o)"));
#if 0
// stuff that must not compile
obj.setName(42);
obj.setFlags(QStringLiteral("42"));
s = obj.getStringList();
obj.setFlags(nullptr);
#endif
#endif
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment