summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2018-11-02 17:27:02 -0700
committerSteven Moreland <smoreland@google.com>2018-11-02 17:41:12 -0700
commit4fc9b6e8de0a4c928d84985867eb2d3c7147bc09 (patch)
tree4a8406f1cf59ca5cd1cd0e4102e001e06aba6779 /tests
parent190473b02b93b11163d724fc5716c111f0cc5d7f (diff)
downloadandroid_hardware_interfaces-4fc9b6e8de0a4c928d84985867eb2d3c7147bc09.tar.gz
android_hardware_interfaces-4fc9b6e8de0a4c928d84985867eb2d3c7147bc09.tar.bz2
android_hardware_interfaces-4fc9b6e8de0a4c928d84985867eb2d3c7147bc09.zip
Tests for Enum#len
Bug: 117951873 Test: hidl_test Change-Id: I532c983f72013446869e3c8e3bbc11c776bfcbfa
Diffstat (limited to 'tests')
-rw-r--r--tests/expression/1.0/IExpression.hal22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/expression/1.0/IExpression.hal b/tests/expression/1.0/IExpression.hal
index 2db9f617c..36aed608a 100644
--- a/tests/expression/1.0/IExpression.hal
+++ b/tests/expression/1.0/IExpression.hal
@@ -147,6 +147,28 @@ interface IExpression {
logand4 = (0 && 1) == 0,
};
+ // Tests for enum tags
+ enum NoElements : uint32_t {};
+ enum OneElement : uint32_t {A};
+ enum TwoElement : uint32_t {A,B};
+ enum TwoCollidingElements : uint32_t {A=1,B=1};
+ enum ThreeFromInheritance : TwoElement {C};
+ enum ThreeFromDoubleInheritance : ThreeFromInheritance {};
+ enum ThreeCollidingFromInheritance : TwoCollidingElements {C};
+
+ enum EnumTagTest : uint32_t {
+ a = NoElements#len == 0,
+ b = OneElement#len == 1,
+ c = TwoElement#len == 2,
+ d = TwoCollidingElements#len == 2,
+ e = ThreeFromInheritance#len == 3,
+ f = ThreeFromDoubleInheritance#len == 3,
+ g = ThreeCollidingFromInheritance#len == 3,
+
+ // fine to reference current enum as well
+ h = EnumTagTest#len == 8,
+ };
+
enum Grayscale : int8_t {
WHITE = 126,
GRAY, // 127