platform_hardware_interfaces/tests/baz/1.0/IBase.hal
Steven Moreland ffb6a481c7 tests.baz@1.0: changes for symmetric tests
Changes to make hidl_test_java symmetric (this implementation mirrors
one in system/tools/hidl).

Bug: 168152294
Test: atest hidl_test_java
Change-Id: I29a468d1804ba494bfe5ca59d68b3ab2581eb9b4
2020-09-25 00:41:32 +00:00

131 lines
3.6 KiB
Text

/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.hardware.tests.baz@1.0;
interface IBase {
enum SomeBaseEnum : int32_t {
grrr = 1,
};
struct Foo {
struct Bar {
float z;
string s;
};
enum FooEnum : int8_t {
first = 1,
second = 2,
};
int32_t x;
vec<Bar> aaa;
Bar y;
};
struct MoreThanOneArrayField {
/**
* Generated (Java) code used to redeclare the same variable name
* multiple times in the same scope, this test ensures that that's no
* longer the case.
*/
string[3] one;
string[5] two;
};
typedef string[3] ThreeStrings;
typedef string[5] FiveStrings;
struct StringMatrix3x5 {
FiveStrings[3] s;
};
struct StringMatrix5x3 {
ThreeStrings[5] s;
};
typedef uint8_t[6] MacAddress;
struct VectorOfArray {
vec<MacAddress> addresses;
};
enum BitField : uint8_t {
V0 = 1 << 0,
V1 = 1 << 1,
V2 = 1 << 2,
V3 = 1 << 3,
};
struct MyMask {
bitfield<BitField> value;
};
typedef bitfield<BitField> Mask;
typedef uint8_t[128] ByteOneDim;
typedef uint8_t[8][128] ByteTwoDim;
typedef uint8_t[8][16][128] ByteThreeDim;
typedef bool[128] BooleanOneDim;
typedef bool[8][128] BooleanTwoDim;
typedef bool[8][16][128] BooleanThreeDim;
typedef double[128] DoubleOneDim;
typedef double[8][128] DoubleTwoDim;
typedef double[8][16][128] DoubleThreeDim;
struct LotsOfPrimitiveArrays {
ByteOneDim byte1;
ByteTwoDim byte2;
ByteThreeDim byte3;
BooleanOneDim boolean1;
BooleanTwoDim boolean2;
BooleanThreeDim boolean3;
DoubleOneDim double1;
DoubleTwoDim double2;
DoubleThreeDim double3;
};
isJava() generates (bool isJava);
someBaseMethod();
someBoolMethod(bool x) generates (bool y);
someBoolArrayMethod(bool[3] x) generates (bool[4] y);
someBoolVectorMethod(vec<bool> x) generates (vec<bool> y);
someOtherBaseMethod(Foo foo) generates (Foo result);
someMethodWithFooArrays(Foo[2] fooInput) generates (Foo[2] fooOutput);
someMethodWithFooVectors(vec<Foo> fooInput) generates (vec<Foo> fooOutput);
someMethodWithVectorOfArray(VectorOfArray in) generates (VectorOfArray out);
someMethodTakingAVectorOfArray(vec<MacAddress> in)
generates (vec<MacAddress> out);
transpose(StringMatrix5x3 in) generates (StringMatrix3x5 out);
transpose2(ThreeStrings[5] in) generates (FiveStrings[3] out);
takeAMask(BitField bf, bitfield<BitField> first, MyMask second, Mask third)
generates (BitField out, uint8_t f, uint8_t s, uint8_t t);
testArrays(LotsOfPrimitiveArrays in) generates (LotsOfPrimitiveArrays out);
testByteVecs(vec<ByteOneDim> in) generates (vec<ByteOneDim> out);
testBooleanVecs(vec<BooleanOneDim> in) generates (vec<BooleanOneDim> out);
testDoubleVecs(vec<DoubleOneDim> in) generates (vec<DoubleOneDim> out);
};