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 17package android.hardware.tests.pointer@1.0; 18 19interface IPointer { 20 struct S { int32_t data; }; 21 struct A { S s; }; 22 // type declarations 23 struct Sam { int32_t data; }; 24 struct Ada { ref<Sam> s_ptr; }; 25 struct Bob { ref<Ada> a_ptr; ref<Sam> s_ptr; }; 26 struct Cin { Ada a; ref<Bob> b_ptr; }; 27 struct Dom { Cin c; }; 28 29 typedef ref<int32_t> Int32Ptr; 30 typedef ref<Sam> SamPtr; 31 32 struct Ptr { 33 ref<Ada>[5] ptr_array; 34 ref<Ada[5]> array_ptr; 35 Int32Ptr int_ptr; 36 ref<int32_t[5]> int_array_ptr; 37 ref<int32_t>[5] int_ptr_array; 38 ref<string> str_ref; 39 vec<ref<Ada>> a_ptr_vec; 40 ref<vec<Ada>> a_vec_ptr; 41 }; 42 43 // test cases 44 foo1(Sam s, SamPtr s_ptr); 45 foo2(Sam s, Ada a); 46 foo3(Sam s, Ada a, Bob b); 47 foo4(ref<Sam> s_ptr); 48 foo5(Ada a, Bob b); 49 foo6(ref<Ada> a_ptr); 50 foo7(ref<Ada> a_ptr, ref<Bob> b_ptr); 51 foo8(Dom d); 52 foo9(ref<string> str_ref); 53 foo10(vec<ref<Sam>> s_ptr_vec); 54 foo11(ref<vec<Sam>> s_vec_ptr); 55 foo12(ref<Sam[5]> s_array_ref); 56 foo13(ref<Sam>[5] s_ref_array); 57 foo14(ref<ref<ref<Sam>>> s_3ptr); 58 foo15(ref<ref<ref<int32_t>>> i_3ptr); 59 foo16(Ptr p); 60 foo17(ref<Ptr> p); 61 foo18(ref<string> str_ref, ref<string> str_ref2, string str); 62 foo19(ref<vec<Ada>> a_vec_ref, vec<Ada> a_vec, ref<vec<Ada>> a_vec_ref2); 63 foo20(vec<ref<Sam>> s_ptr_vec); 64 foo21(ref<Ada[1][2][3]> a_array_ptr); 65 foo22(ref<Ada>[1][2][3] a_ptr_array); 66 67 bar1() generates (Sam s, ref<Sam> s_ptr); 68 bar2() generates (Sam s, Ada a); 69 bar3() generates (Sam s, Ada a, Bob b); 70 bar4() generates (ref<Sam> s_ptr); 71 bar5() generates (Ada a, Bob b); 72 bar6() generates (ref<Ada> a_ptr); 73 bar7() generates (ref<Ada> a_ptr, ref<Bob> b_ptr); 74 bar8() generates (Dom d); 75 bar9() generates (ref<string> str_ref); 76 bar10() generates (vec<ref<Sam>> s_ptr_vec); 77 bar11() generates (ref<vec<Sam>> s_vec_ptr); 78 bar12() generates (ref<Sam[5]> s_array_ref); 79 bar13() generates (ref<Sam>[5] s_ref_array); 80 bar14() generates (ref<ref<ref<Sam>>> s_3ptr); 81 bar15() generates (ref<ref<ref<int32_t>>> i_3ptr); 82 bar16() generates (Ptr p); 83 bar17() generates (ref<Ptr> p); 84 bar18() generates (ref<string> str_ref, ref<string> str_ref2, string str); 85 bar19() generates (ref<vec<Ada>> a_vec_ref, vec<Ada> a_vec, ref<vec<Ada>> a_vec_ref2); 86 bar20() generates (vec<ref<Sam>> s_ptr_vec); 87 bar21() generates (ref<Ada[1][2][3]> a_array_ptr); 88 bar22() generates (ref<Ada>[1][2][3] a_ptr_array); 89 90 getErrors() generates(int32_t errors); 91}; 92