summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSteven Moreland2018-10-05 11:42:21 -0500
committerSteven Moreland2018-10-08 15:11:34 -0500
commit2b01956dac6125a54efa78b31ab52ffec50ebb8f (patch)
treeed2eb087bcd940c7ab743b3389475bec46fbde0b /tests
parent999693e4e83c71c7d84a10825d4f5101f5f2c0b1 (diff)
downloadplatform-hardware-interfaces-2b01956dac6125a54efa78b31ab52ffec50ebb8f.tar.gz
platform-hardware-interfaces-2b01956dac6125a54efa78b31ab52ffec50ebb8f.tar.xz
platform-hardware-interfaces-2b01956dac6125a54efa78b31ab52ffec50ebb8f.zip
IFoo: send struct with fmq.
Bug: 117239572 Test: hidl_test Change-Id: I968916a9d62e1c8f7a237bd24e6b4267dd013366
Diffstat (limited to 'tests')
-rw-r--r--tests/bar/1.0/default/Bar.cpp4
-rw-r--r--tests/bar/1.0/default/Bar.h2
-rw-r--r--tests/foo/1.0/IFoo.hal6
-rw-r--r--tests/foo/1.0/default/Foo.cpp5
-rw-r--r--tests/foo/1.0/default/Foo.h3
5 files changed, 20 insertions, 0 deletions
diff --git a/tests/bar/1.0/default/Bar.cpp b/tests/bar/1.0/default/Bar.cpp
index 46144281..0a57b40c 100644
--- a/tests/bar/1.0/default/Bar.cpp
+++ b/tests/bar/1.0/default/Bar.cpp
@@ -149,6 +149,10 @@ Return<void> Bar::closeHandles() {
149 return mFoo->closeHandles(); 149 return mFoo->closeHandles();
150} 150}
151 151
152Return<void> Bar::repeatWithFmq(const IFoo::WithFmq& withFmq, repeatWithFmq_cb _hidl_cb) {
153 return mFoo->repeatWithFmq(withFmq, _hidl_cb);
154}
155
152Return<void> Bar::echoNullInterface(const sp<IFooCallback> &cb, echoNullInterface_cb _hidl_cb) { 156Return<void> Bar::echoNullInterface(const sp<IFooCallback> &cb, echoNullInterface_cb _hidl_cb) {
153 return mFoo->echoNullInterface(cb, _hidl_cb); 157 return mFoo->echoNullInterface(cb, _hidl_cb);
154} 158}
diff --git a/tests/bar/1.0/default/Bar.h b/tests/bar/1.0/default/Bar.h
index acb976f8..4372266e 100644
--- a/tests/bar/1.0/default/Bar.h
+++ b/tests/bar/1.0/default/Bar.h
@@ -56,6 +56,8 @@ struct Bar : public IBar {
56 virtual Return<void> createMyHandle(createMyHandle_cb _hidl_cb) override; 56 virtual Return<void> createMyHandle(createMyHandle_cb _hidl_cb) override;
57 virtual Return<void> createHandles(uint32_t size, createHandles_cb _hidl_cb) override; 57 virtual Return<void> createHandles(uint32_t size, createHandles_cb _hidl_cb) override;
58 virtual Return<void> closeHandles() override; 58 virtual Return<void> closeHandles() override;
59 virtual Return<void> repeatWithFmq(const IFoo::WithFmq& withFmq,
60 repeatWithFmq_cb _hidl_cb) override;
59 61
60 Return<void> haveAVectorOfInterfaces( 62 Return<void> haveAVectorOfInterfaces(
61 const hidl_vec<sp<ISimple> > &in, 63 const hidl_vec<sp<ISimple> > &in,
diff --git a/tests/foo/1.0/IFoo.hal b/tests/foo/1.0/IFoo.hal
index 9642e2a8..f54994f5 100644
--- a/tests/foo/1.0/IFoo.hal
+++ b/tests/foo/1.0/IFoo.hal
@@ -121,6 +121,10 @@ interface IFoo {
121 bitfield<BitField> bf; 121 bitfield<BitField> bf;
122 }; 122 };
123 123
124 struct WithFmq {
125 fmq_sync<uint8_t> descSync;
126 };
127
124 enum Discriminator : uint8_t { 128 enum Discriminator : uint8_t {
125 BOOL, 129 BOOL,
126 INT, 130 INT,
@@ -204,4 +208,6 @@ interface IFoo {
204 createMyHandle() generates (MyHandle h); 208 createMyHandle() generates (MyHandle h);
205 createHandles(uint32_t size) generates (vec<handle> handles); 209 createHandles(uint32_t size) generates (vec<handle> handles);
206 closeHandles(); 210 closeHandles();
211
212 repeatWithFmq(WithFmq withFmq) generates (WithFmq withFmq);
207}; 213};
diff --git a/tests/foo/1.0/default/Foo.cpp b/tests/foo/1.0/default/Foo.cpp
index a31ab9f0..461568bb 100644
--- a/tests/foo/1.0/default/Foo.cpp
+++ b/tests/foo/1.0/default/Foo.cpp
@@ -379,6 +379,11 @@ Return<void> Foo::echoNullInterface(const sp<IFooCallback> &cb, echoNullInterfac
379 return Void(); 379 return Void();
380} 380}
381 381
382Return<void> Foo::repeatWithFmq(const IFoo::WithFmq& withFmq, repeatWithFmq_cb _hidl_cb) {
383 _hidl_cb(withFmq);
384 return Void();
385}
386
382IFoo* HIDL_FETCH_IFoo(const char* /* name */) { 387IFoo* HIDL_FETCH_IFoo(const char* /* name */) {
383 return new Foo(); 388 return new Foo();
384} 389}
diff --git a/tests/foo/1.0/default/Foo.h b/tests/foo/1.0/default/Foo.h
index 7dd672b8..d73179a8 100644
--- a/tests/foo/1.0/default/Foo.h
+++ b/tests/foo/1.0/default/Foo.h
@@ -53,6 +53,8 @@ struct Foo : public IFoo {
53 virtual Return<void> createMyHandle(createMyHandle_cb _hidl_cb) override; 53 virtual Return<void> createMyHandle(createMyHandle_cb _hidl_cb) override;
54 virtual Return<void> createHandles(uint32_t size, createHandles_cb _hidl_cb) override; 54 virtual Return<void> createHandles(uint32_t size, createHandles_cb _hidl_cb) override;
55 virtual Return<void> closeHandles() override; 55 virtual Return<void> closeHandles() override;
56 virtual Return<void> repeatWithFmq(const IFoo::WithFmq& withFmq,
57 repeatWithFmq_cb _hidl_cb) override;
56 58
57 Return<void> haveAVectorOfInterfaces( 59 Return<void> haveAVectorOfInterfaces(
58 const hidl_vec<sp<ISimple> > &in, 60 const hidl_vec<sp<ISimple> > &in,
@@ -63,6 +65,7 @@ struct Foo : public IFoo {
63 haveAVectorOfGenericInterfaces_cb _hidl_cb) override; 65 haveAVectorOfGenericInterfaces_cb _hidl_cb) override;
64 66
65 Return<void> echoNullInterface(const sp<IFooCallback> &cb, echoNullInterface_cb _hidl_cb) override; 67 Return<void> echoNullInterface(const sp<IFooCallback> &cb, echoNullInterface_cb _hidl_cb) override;
68
66private: 69private:
67 std::vector<::native_handle_t *> mHandles; 70 std::vector<::native_handle_t *> mHandles;
68}; 71};