Modified fmq client-side testcase
am: 066fa3f609
Change-Id: I44c43941e802e835a62bb8f537c584764f5d7efb
diff --git a/tests/msgq_test_client.cpp b/tests/msgq_test_client.cpp
index 50664f7..ce7e340 100644
--- a/tests/msgq_test_client.cpp
+++ b/tests/msgq_test_client.cpp
@@ -72,17 +72,19 @@
}
virtual void SetUp() {
+ static constexpr size_t kNumElementsInQueue = 1024;
mService = waitGetTestService();
ASSERT_NE(mService, nullptr);
ASSERT_TRUE(mService->isRemote());
- mService->configureFmqSyncReadWrite([this](
- bool ret, const MQDescriptorSync<uint16_t>& in) {
- ASSERT_TRUE(ret);
- mQueue = new (std::nothrow) MessageQueueSync(in);
- });
+ // create a queue on the client side
+ mQueue = new (std::nothrow)
+ MessageQueueSync(kNumElementsInQueue, true /* configure event flag word */);
ASSERT_NE(nullptr, mQueue);
ASSERT_TRUE(mQueue->isValid());
mNumMessagesMax = mQueue->getQuantumCount();
+
+ // tell server to set up the queue on its end
+ ASSERT_TRUE(mService->configureFmqSyncReadWrite(*mQueue->getDesc()));
}
sp<ITestMsgQ> mService;