diff options
Diffstat (limited to 'tests/java/src/android/aidl/tests/TestServiceClient.java')
-rw-r--r-- | tests/java/src/android/aidl/tests/TestServiceClient.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/java/src/android/aidl/tests/TestServiceClient.java b/tests/java/src/android/aidl/tests/TestServiceClient.java index 098ad209..6f298864 100644 --- a/tests/java/src/android/aidl/tests/TestServiceClient.java +++ b/tests/java/src/android/aidl/tests/TestServiceClient.java @@ -134,6 +134,28 @@ public class TestServiceClient { } @Test + public void testConstFloatRepeat() throws RemoteException { + float query[] = {ITestService.FLOAT_TEST_CONSTANT, ITestService.FLOAT_TEST_CONSTANT2, + ITestService.FLOAT_TEST_CONSTANT3, ITestService.FLOAT_TEST_CONSTANT4, + ITestService.FLOAT_TEST_CONSTANT5, ITestService.FLOAT_TEST_CONSTANT6, + ITestService.FLOAT_TEST_CONSTANT7}; + for (int i = 0; i < query.length; i++) { + assertThat(service.RepeatFloat(query[i]), is(query[i])); + } + } + + @Test + public void testConstDoubleRepeat() throws RemoteException { + double query[] = {ITestService.DOUBLE_TEST_CONSTANT, ITestService.DOUBLE_TEST_CONSTANT2, + ITestService.DOUBLE_TEST_CONSTANT3, ITestService.DOUBLE_TEST_CONSTANT4, + ITestService.DOUBLE_TEST_CONSTANT5, ITestService.DOUBLE_TEST_CONSTANT6, + ITestService.DOUBLE_TEST_CONSTANT7}; + for (int i = 0; i < query.length; i++) { + assertThat(service.RepeatDouble(query[i]), is(query[i])); + } + } + + @Test public void testLongRepeat() throws RemoteException { long query = 1L << 60; assertThat(service.RepeatLong(query), is(query)); @@ -646,6 +668,14 @@ public class TestServiceClient { } } + @Test + public void testOutArrayWithNull() throws RemoteException { + // In Java out-array parameter can't be null. The proxy code always throws NPE. + assertThrows(NullPointerException.class, () -> service.ReverseUtf8CppString(null, null)); + assertThrows(NullPointerException.class, + () -> service.ReverseNullableUtf8CppString(null, null)); + } + private void shouldBeTheSame(StructuredParcelable a, StructuredParcelable b) { assertTrue(a.equals(b)); assertTrue(b.equals(a)); |