platform_hardware_interfaces/tests/baz/1.0/IBase.hal
Steven Moreland d26dc50abb Always specify underlying enum type.
Bug: 33197891
Test: compiles
Change-Id: I3d4822ea9a665708302d3bd1460425fddf1dcda9
2016-11-29 14:22:10 -08:00

84 lines
2.3 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;
};
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);
};