blob: 3f18d411904706ff2be29f07a26745fe5ca04bd5 [file] [log] [blame]
Andreas Huberfc0b6c42016-09-22 09:47:48 -07001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Andreas Huber669bf7a2016-08-29 10:23:17 -070017package android.hardware.tests.baz@1.0;
18
19interface IBase {
20 enum SomeBaseEnum {
21 grrr = 1,
22 };
23
24 struct Foo {
25 struct Bar {
26 float z;
27 string s;
28 };
29
30 enum FooEnum : int8_t {
31 first = 1,
32 second = 2,
33 };
34
35 int32_t x;
36 vec<Bar> aaa;
37 Bar y;
38 };
39
Andreas Huberfc0b6c42016-09-22 09:47:48 -070040 struct MoreThanOneArrayField {
41 /*
42 * Generated (Java) code used to redeclare the same variable name
43 * multiple times in the same scope, this test ensures that that's no
44 * longer the case.
45 */
46 string[3] one;
47 string[5] two;
48 };
49
Andreas Huber9c43f012016-09-14 15:27:21 -070050 typedef string[3] ThreeStrings;
51 typedef string[5] FiveStrings;
52
53 struct StringMatrix3x5 {
54 FiveStrings[3] s;
55 };
56
57 struct StringMatrix5x3 {
58 ThreeStrings[5] s;
59 };
60
Andreas Huberfd77f502016-09-23 12:16:36 -070061 typedef uint8_t[6] MacAddress;
62
63 struct VectorOfArray {
64 vec<MacAddress> addresses;
65 };
66
Andreas Huber669bf7a2016-08-29 10:23:17 -070067 someBaseMethod();
68
69 someBoolMethod(bool x) generates (bool y);
70 someBoolArrayMethod(bool[3] x) generates (bool[4] y);
71 someBoolVectorMethod(vec<bool> x) generates (vec<bool> y);
72
73 someOtherBaseMethod(Foo foo) generates (Foo result);
Andreas Huberf399e502016-09-09 14:56:15 -070074 someMethodWithFooArrays(Foo[2] fooInput) generates (Foo[2] fooOutput);
75 someMethodWithFooVectors(vec<Foo> fooInput) generates (vec<Foo> fooOutput);
Andreas Huber9c43f012016-09-14 15:27:21 -070076
Andreas Huberfd77f502016-09-23 12:16:36 -070077 someMethodWithVectorOfArray(VectorOfArray in) generates (VectorOfArray out);
78
Andreas Huber9c43f012016-09-14 15:27:21 -070079 transpose(StringMatrix5x3 in) generates (StringMatrix3x5 out);
Andreas Huber8e237942016-09-19 13:59:52 -070080 transpose2(ThreeStrings[5] in) generates (FiveStrings[3] out);
Andreas Huber669bf7a2016-08-29 10:23:17 -070081};