feat: add createLightWeightProxy overload for convenience (#474)

This commit is contained in:
Stanislav Angelovič
2025-01-08 13:55:38 +01:00
committed by GitHub
parent fafe8487ff
commit 48ea775531
4 changed files with 37 additions and 9 deletions
+2 -2
View File
@@ -351,7 +351,7 @@ TYPED_TEST(SdbusTestObject, CanRegisterAdditionalVTableDynamicallyAtAnyTime)
, sdbus::return_slot );
// The new remote vtable is registered as long as we keep vtableSlot, so remote method calls now should pass
auto proxy = sdbus::createProxy(SERVICE_NAME, OBJECT_PATH, sdbus::dont_run_event_loop_thread);
auto proxy = sdbus::createLightWeightProxy(SERVICE_NAME, OBJECT_PATH);
int result{};
proxy->callMethod("subtract").onInterface(interfaceName).withArguments(10, 2).storeResultsTo(result);
@@ -370,6 +370,6 @@ TYPED_TEST(SdbusTestObject, CanUnregisterAdditionallyRegisteredVTableAtAnyTime)
vtableSlot.reset(); // Letting the slot go means letting go the associated vtable registration
// No such remote D-Bus method under given interface exists anymore...
auto proxy = sdbus::createProxy(SERVICE_NAME, OBJECT_PATH, sdbus::dont_run_event_loop_thread);
auto proxy = sdbus::createLightWeightProxy(SERVICE_NAME, OBJECT_PATH);
ASSERT_THROW(proxy->callMethod("subtract").onInterface(interfaceName).withArguments(10, 2), sdbus::Error);
}