diff options
author | Philip Rauwolf <rauwolf@itestra.de> | 2013-02-26 18:25:18 +0100 |
---|---|---|
committer | Philip Rauwolf <rauwolf@itestra.de> | 2013-02-26 18:25:18 +0100 |
commit | dfb30d0ef8303b41a91f3c03418372b9e289da3b (patch) | |
tree | 5ba4f53d245c1c6188cd89d9e353f591cbb1e39c | |
parent | d5c7d8da8c5590cd94f4e4d6e502a867876d5e8e (diff) | |
download | genivi-common-api-dbus-runtime-dfb30d0ef8303b41a91f3c03418372b9e289da3b.tar.gz |
Added Test for Proxies: Async Callbacks should be called even if the
proxy is marked as "NOT_AVAILABLE"
-rw-r--r-- | src/test/DBusProxyTest.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/DBusProxyTest.cpp b/src/test/DBusProxyTest.cpp index afaf1ed..e583f38 100644 --- a/src/test/DBusProxyTest.cpp +++ b/src/test/DBusProxyTest.cpp @@ -233,6 +233,21 @@ TEST_F(ProxyTest, TestInterfaceVersionAttribute) { ASSERT_EQ(CommonAPI::CallStatus::NOT_AVAILABLE, status); } +TEST_F(ProxyTest, AsyncCallbacksAreCalledIfServiceNotAvailable) { + commonapi::tests::DerivedTypeCollection::TestEnumExtended2 testInputStruct; + commonapi::tests::DerivedTypeCollection::TestMap testInputMap; + bool wasCalled = false; + proxy_->testDerivedTypeMethodAsync(testInputStruct, testInputMap, [&] (const CommonAPI::CallStatus& callStatus, + const commonapi::tests::DerivedTypeCollection::TestEnumExtended2&, + const commonapi::tests::DerivedTypeCollection::TestMap&) { + ASSERT_EQ(callStatus, CommonAPI::CallStatus::NOT_AVAILABLE); + wasCalled = true; + } + ); + sleep(1); + ASSERT_TRUE(wasCalled); +} + int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); |