diff --git a/include/sdbus-c++/IProxy.h b/include/sdbus-c++/IProxy.h index 0594bf2..0d00131 100644 --- a/include/sdbus-c++/IProxy.h +++ b/include/sdbus-c++/IProxy.h @@ -293,6 +293,8 @@ namespace sdbus { class PendingAsyncCall { public: + PendingAsyncCall() = default; + /*! * @brief Cancels the delivery of the pending asynchronous call result * diff --git a/tests/integrationtests/DBusAsyncMethodsTests.cpp b/tests/integrationtests/DBusAsyncMethodsTests.cpp index 7c185f4..cb0f5cc 100644 --- a/tests/integrationtests/DBusAsyncMethodsTests.cpp +++ b/tests/integrationtests/DBusAsyncMethodsTests.cpp @@ -201,6 +201,22 @@ TEST_F(SdbusTestObject, AnswersThatAsyncCallIsNotPendingAfterItHasBeenCompleted) ASSERT_TRUE(waitUntil([&call](){ return !call.isPending(); })); } +TEST_F(SdbusTestObject, AnswersThatDefaultConstructedAsyncCallIsNotPending) +{ + sdbus::PendingAsyncCall call; + + ASSERT_FALSE(call.isPending()); +} + +TEST_F(SdbusTestObject, SupportsAsyncCallCopyAssignment) +{ + sdbus::PendingAsyncCall call; + + call = m_proxy->doOperationClientSideAsync(100); + + ASSERT_TRUE(call.isPending()); +} + TEST_F(SdbusTestObject, InvokesErroneousMethodAsynchronouslyOnClientSide) { std::promise promise;