Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Itinerary
Commits
951ae339
Commit
951ae339
authored
Nov 29, 2021
by
Volker Krause
Browse files
Add tests for calling JNI methods with a nullptr argument
parent
5f4b100c
Changes
1
Hide whitespace changes
Inline
Side-by-side
autotests/jnimethodtest.cpp
View file @
951ae339
...
...
@@ -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
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment