Martijn Coenen | cbe590c | 2016-08-30 11:27:56 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
Yifan Hong | ab407f0 | 2016-08-12 17:39:44 -0700 | [diff] [blame] | 17 | package android.hardware.tests.expression@1.0; |
| 18 | |
| 19 | @hal_type(type="LIGHT") |
| 20 | |
| 21 | interface IExpression { |
| 22 | enum int_literals : int32_t { |
| 23 | literal = 4, |
| 24 | literalL = -4L, |
| 25 | simpleArithmetic = 4 + 1, |
| 26 | simpleIdentifier = literalL, |
| 27 | simpleIdentifier2 = literalL + simpleArithmetic, |
| 28 | boolExpr = 1 == 7 && !((3 != 4 || (2 < 3 <= 3 > 4)) >= 0), |
| 29 | bitExpr = ~42 & (1 << 3 | 16 >> 2) ^ 7, |
| 30 | arithmeticExpr = 2 + 3 - 4 * -7 / (10 % 3), |
| 31 | messyExpr = 2 + (-3&4 / 7), |
| 32 | paranExpr = (((((1 + 1))))), |
| 33 | ternary = 1?2:3, |
| 34 | ternary2 = 1&&2?3:4, |
| 35 | complicatedTernary2 = 1 - 1 && 2 + 3 || 5 ? 7 * 8 : -3 |
| 36 | }; |
| 37 | // const float SIMPLE_FLOAT1 = 1e20; |
| 38 | // const float SIMPLE_FLOAT2 = 1e-10L; |
| 39 | // const float SIMPLE_FLOAT3 = 1.; |
| 40 | // const float SIMPLE_FLOAT4 = 1.e-2; |
| 41 | // const float SIMPLE_FLOAT5 = 3.1416; |
| 42 | // const float SIMPLE_FLOAT6 = .5f; |
| 43 | // const float SIMPLE_FLOAT7 = 0.5e-3L; |
| 44 | // struct expressionist_t { |
| 45 | // uint8_t[1 << 10] buffer; |
| 46 | // }; |
| 47 | // @param(name = "mask", normal = 1 << 5) |
| 48 | // setExpression(expressionist_t state, int32_t mask) generates (int32_t ret); |
| 49 | }; |