diff options
author | Howard Chen | 2018-01-04 22:11:25 -0600 |
---|---|---|
committer | android-build-merger | 2018-01-04 22:11:25 -0600 |
commit | 5fbc2279f3bde278b0ab5155c690cda43f47bf4b (patch) | |
tree | d750723e145b4a412a878af7ca6f44e78ae9ca63 /tests | |
parent | c29a0ebf4c8c37110c1f2fe6db4dbc503eb5782a (diff) | |
parent | 3495400a593fafde5fd81c2bfd28513d046efb1a (diff) | |
download | platform-hardware-interfaces-5fbc2279f3bde278b0ab5155c690cda43f47bf4b.tar.gz platform-hardware-interfaces-5fbc2279f3bde278b0ab5155c690cda43f47bf4b.tar.xz platform-hardware-interfaces-5fbc2279f3bde278b0ab5155c690cda43f47bf4b.zip |
Merge "Add a test method to test interface in struct" am: c0204ee13d am: 932c93f52e
am: 3495400a59
Change-Id: I6e58800fde8a6a44d342e15b9c79d02a9e5f7156
Diffstat (limited to 'tests')
-rw-r--r-- | tests/baz/1.0/IBaz.hal | 6 | ||||
-rw-r--r-- | tests/baz/1.0/default/Baz.cpp | 6 | ||||
-rw-r--r-- | tests/baz/1.0/default/Baz.h | 2 |
3 files changed, 14 insertions, 0 deletions
diff --git a/tests/baz/1.0/IBaz.hal b/tests/baz/1.0/IBaz.hal index 8c6a9a45..9a9e7545 100644 --- a/tests/baz/1.0/IBaz.hal +++ b/tests/baz/1.0/IBaz.hal | |||
@@ -68,6 +68,10 @@ interface IBaz extends IBase { | |||
68 | bitfield<BitField> bf; | 68 | bitfield<BitField> bf; |
69 | }; | 69 | }; |
70 | 70 | ||
71 | struct StructWithInterface { | ||
72 | int32_t number; | ||
73 | IBase dummy; | ||
74 | }; | ||
71 | oneway doThis(float param); | 75 | oneway doThis(float param); |
72 | 76 | ||
73 | doThatAndReturnSomething(int64_t param) generates (int32_t result); | 77 | doThatAndReturnSomething(int64_t param) generates (int32_t result); |
@@ -93,4 +97,6 @@ interface IBaz extends IBase { | |||
93 | size(uint32_t size) generates (uint32_t size); | 97 | size(uint32_t size) generates (uint32_t size); |
94 | 98 | ||
95 | getNestedStructs() generates(vec<NestedStruct> data); | 99 | getNestedStructs() generates(vec<NestedStruct> data); |
100 | |||
101 | haveSomeStructWithInterface(StructWithInterface swi) generates(StructWithInterface swi); | ||
96 | }; | 102 | }; |
diff --git a/tests/baz/1.0/default/Baz.cpp b/tests/baz/1.0/default/Baz.cpp index 5ccd87b4..e118122e 100644 --- a/tests/baz/1.0/default/Baz.cpp +++ b/tests/baz/1.0/default/Baz.cpp | |||
@@ -394,6 +394,12 @@ Return<void> Baz::getNestedStructs(getNestedStructs_cb _hidl_cb) { | |||
394 | _hidl_cb(result); | 394 | _hidl_cb(result); |
395 | return Void(); | 395 | return Void(); |
396 | } | 396 | } |
397 | |||
398 | Return<void> Baz::haveSomeStructWithInterface(const StructWithInterface& swi, | ||
399 | haveSomeStructWithInterface_cb _hidl_cb) { | ||
400 | _hidl_cb(swi); | ||
401 | return Void(); | ||
402 | } | ||
397 | // Methods from ::android::hidl::base::V1_0::IBase follow. | 403 | // Methods from ::android::hidl::base::V1_0::IBase follow. |
398 | 404 | ||
399 | IBaz* HIDL_FETCH_IBaz(const char* /* name */) { | 405 | IBaz* HIDL_FETCH_IBaz(const char* /* name */) { |
diff --git a/tests/baz/1.0/default/Baz.h b/tests/baz/1.0/default/Baz.h index 4443587b..c264f47a 100644 --- a/tests/baz/1.0/default/Baz.h +++ b/tests/baz/1.0/default/Baz.h | |||
@@ -91,6 +91,8 @@ struct Baz : public IBaz { | |||
91 | Return<uint32_t> size(uint32_t size) override; | 91 | Return<uint32_t> size(uint32_t size) override; |
92 | Return<void> getNestedStructs(getNestedStructs_cb _hidl_cb) override; | 92 | Return<void> getNestedStructs(getNestedStructs_cb _hidl_cb) override; |
93 | 93 | ||
94 | Return<void> haveSomeStructWithInterface(const StructWithInterface& swi, | ||
95 | haveSomeStructWithInterface_cb _hidl_cb) override; | ||
94 | // Methods from ::android::hidl::base::V1_0::IBase follow. | 96 | // Methods from ::android::hidl::base::V1_0::IBase follow. |
95 | private: | 97 | private: |
96 | sp<IBazCallback> mStoredCallback; | 98 | sp<IBazCallback> mStoredCallback; |