Skip to content

Commit

Permalink
iox-eclipse-iceoryx#1295 Update related icediscovery_in_c example acc…
Browse files Browse the repository at this point in the history
…ordingly

Signed-off-by: Simon Hoinkis <[email protected]>
  • Loading branch information
mossmaurice committed Mar 30, 2022
1 parent 20083c4 commit cd6e531
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions iceoryx_examples/icediscovery_in_c/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ We can now call three different find service functions. Let's start with
<!--[geoffrey][iceoryx_examples/icediscovery_in_c/iox_c_find_service.c][find service and apply callable]-->
```c
iox_service_discovery_find_service_apply_callable(
serviceDiscovery, "Radar", "FrontLeft", "Image", printSearchResult, MessagingPattern_PUB_SUB);
serviceDiscovery, "Radar", "FrontLeft", "Objects", printSearchResult, MessagingPattern_PUB_SUB);
```
which searches for all `{Radar, FrontLeft, Image}` services offered by
which searches for all `{Radar, FrontLeft, Objects}` services offered by
publishers and applies the provided function `printSearchResult` on each of
them. The function must have the signature
`void(const iox_service_description_t)`. Here we pass a function that prints the
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_examples/icediscovery_in_c/iox_c_find_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ int main()

printf("\n=========================================\n");

printf("\nSearched for {'Radar', 'FrontLeft', 'Image'}. Found the following services:\n");
printf("\nSearched for {'Radar', 'FrontLeft', 'Objects'}. Found the following services:\n");
//! [find service and apply callable]
iox_service_discovery_find_service_apply_callable(
serviceDiscovery, "Radar", "FrontLeft", "Image", printSearchResult, MessagingPattern_PUB_SUB);
serviceDiscovery, "Radar", "FrontLeft", "Objects", printSearchResult, MessagingPattern_PUB_SUB);
//! [find service and apply callable]

printf("\nSearched for {'Radar', *, *}. Found the following services:\n");
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_examples/icediscovery_in_c/iox_c_offer_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ int main()
iox_pub_storage_t publisherStorage;
iox_pub_options_t options;
iox_pub_options_init(&options);
iox_pub_t radarLeft = iox_pub_init(&publisherStorage, "Radar", "FrontLeft", "Image", &options);
iox_pub_t radarRight = iox_pub_init(&publisherStorage, "Radar", "FrontRight", "Image", &options);
iox_pub_t radarLeft = iox_pub_init(&publisherStorage, "Radar", "FrontLeft", "Objects", &options);
iox_pub_t radarRight = iox_pub_init(&publisherStorage, "Radar", "FrontRight", "Objects", &options);
iox_pub_t lidarLeft = iox_pub_init(&publisherStorage, "Lidar", "FrontLeft", "Counter", &options);

iox_pub_storage_t cameraPublisherStorage[NUMBER_OF_CAMERA_PUBLISHERS];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def generate_test_description():

proc_env = os.environ.copy()
colcon_prefix_path = os.environ.get('COLCON_PREFIX_PATH', '')
executable_list = ['iox-offer-service', 'iox-find-service']
executable_list = ['iox-cpp-offer-service', 'iox-cpp-find-service']
process_list = []

for exec in executable_list:
Expand Down Expand Up @@ -64,7 +64,7 @@ def generate_test_description():
process_list[1],
roudi_process,
launch_testing.actions.ReadyToTest()
]), {'iox-offer-service': process_list[0], 'iox-find-service': process_list[1],
]), {'iox-cpp-offer-service': process_list[0], 'iox-cpp-find-service': process_list[1],
'roudi_process': roudi_process}

# These tests will run concurrently with the dut process. After this test is done,
Expand Down Expand Up @@ -103,7 +103,7 @@ def test_find_service(self, proc_output):
'Searched for {*, \'FrontLeft\', *}. Found the following services:\n- Service: Radar, Instance: FrontLeft, Event: Objects\n- Service: Lidar, Instance: FrontLeft, Event: Counter',
timeout=45, stream='stdout')
proc_output.assertWaitFor(
'Searched for {*, \'FrontRight\', \'Image\'}. Found the following services:\n- Service: Radar, Instance: FrontRight, Event: Objects',
'Searched for {*, \'FrontRight\', \'Image\'}. Found the following services:',
timeout=45, stream='stdout')
proc_output.assertWaitFor(
'Searched for {\'Camera\', *, *}. Found the following services:',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ def test_roudi_ready(self, proc_output):

def test_find_service(self, proc_output):
proc_output.assertWaitFor(
'Searched for {\'Radar\', \'FrontLeft\', \'Image\'}. Found the following services:\n- Service: Radar, Instance: FrontLeft, Event: Image',
'Searched for {\'Radar\', \'FrontLeft\', \'Objects\'}. Found the following services:\n- Service: Radar, Instance: FrontLeft, Event: Objects',
timeout=45, stream='stdout')
proc_output.assertWaitFor(
'Searched for {\'Radar\', *, *}. Found the following services:\n- Service: Radar, Instance: FrontLeft, Event: Image\n- Service: Radar, Instance: FrontRight, Event: Image',
'Searched for {\'Radar\', *, *}. Found the following services:\n- Service: Radar, Instance: FrontLeft, Event: Objects\n- Service: Radar, Instance: FrontRight, Event: Objects',
timeout=45, stream='stdout')
proc_output.assertWaitFor(
'Searched for {*, \'FrontLeft\', *}. Found the following services:\n- Service: Radar, Instance: FrontLeft, Event: Image\n- Service: Lidar, Instance: FrontLeft, Event: Counter\n- Service: Camera, Instance: FrontLeft, Event: Image\n- Service: Camera, Instance: FrontLeft, Event: Counter',
'Searched for {*, \'FrontLeft\', *}. Found the following services:\n- Service: Radar, Instance: FrontLeft, Event: Objects\n- Service: Lidar, Instance: FrontLeft, Event: Counter\n- Service: Camera, Instance: FrontLeft, Event: Image\n- Service: Camera, Instance: FrontLeft, Event: Counter',
timeout=45, stream='stdout')
proc_output.assertWaitFor(
'Searched for {*, \'FrontRight\', \'Image\'}. Found the following services:\n- Service: Radar, Instance: FrontRight, Event: Image\n- Service: Camera, Instance: FrontRight, Event: Image',
'Searched for {*, \'FrontRight\', \'Image\'}. Found the following services:\n- Service: Camera, Instance: FrontRight, Event: Image',
timeout=45, stream='stdout')
proc_output.assertWaitFor(
'Searched for {\'Camera\', *, *}. Found the following services:\n- Service: Camera, Instance: FrontLeft, Event: Image\n- Service: Camera, Instance: FrontRight, Event: Counter\n- Service: Camera, Instance: FrontRight, Event: Image\n- Service: Camera, Instance: BackLeft, Event: Image\n- Service: Camera, Instance: FrontLeft, Event: Counter',
Expand All @@ -97,16 +97,16 @@ def test_find_service(self, proc_output):
timeout=45, stream='stdout')

proc_output.assertWaitFor(
'Searched for {\'Radar\', \'FrontLeft\', \'Image\'}. Found the following services:\n- Service: Radar, Instance: FrontLeft, Event: Image',
'Searched for {\'Radar\', \'FrontLeft\', \'Objects\'}. Found the following services:\n- Service: Radar, Instance: FrontLeft, Event: Objects',
timeout=45, stream='stdout')
proc_output.assertWaitFor(
'Searched for {\'Radar\', *, *}. Found the following services:\n- Service: Radar, Instance: FrontLeft, Event: Image\n- Service: Radar, Instance: FrontRight, Event: Image',
'Searched for {\'Radar\', *, *}. Found the following services:\n- Service: Radar, Instance: FrontLeft, Event: Objects\n- Service: Radar, Instance: FrontRight, Event: Objects',
timeout=45, stream='stdout')
proc_output.assertWaitFor(
'Searched for {*, \'FrontLeft\', *}. Found the following services:\n- Service: Radar, Instance: FrontLeft, Event: Image\n- Service: Lidar, Instance: FrontLeft, Event: Counter',
'Searched for {*, \'FrontLeft\', *}. Found the following services:\n- Service: Radar, Instance: FrontLeft, Event: Objects\n- Service: Lidar, Instance: FrontLeft, Event: Counter',
timeout=45, stream='stdout')
proc_output.assertWaitFor(
'Searched for {*, \'FrontRight\', \'Image\'}. Found the following services:\n- Service: Radar, Instance: FrontRight, Event: Image',
'Searched for {*, \'FrontRight\', \'Image\'}. Found the following services:',
timeout=45, stream='stdout')
proc_output.assertWaitFor(
'Searched for {\'Camera\', *, *}. Found the following services:',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def generate_test_description():

proc_env = os.environ.copy()
colcon_prefix_path = os.environ.get('COLCON_PREFIX_PATH', '')
executable_list = ['iox-offer-service', 'iox-wait-for-service', 'iox-discovery-monitor']
executable_list = ['iox-cpp-offer-service', 'iox-cpp-wait-for-service', 'iox-cpp-discovery-monitor']
process_list = []

for exec in executable_list:
Expand Down Expand Up @@ -65,8 +65,8 @@ def generate_test_description():
process_list[2],
roudi_process,
launch_testing.actions.ReadyToTest()
]), {'iox-offer-service': process_list[0], 'iox-wait-for-service': process_list[1],
'iox-discovery-monitor': process_list[2], 'roudi_process': roudi_process}
]), {'iox-cpp-offer-service': process_list[0], 'iox-cpp-wait-for-service': process_list[1],
'iox-cpp-discovery-monitor': process_list[2], 'roudi_process': roudi_process}

# These tests will run concurrently with the dut process. After this test is done,
# the launch system will shut down RouDi
Expand Down

0 comments on commit cd6e531

Please sign in to comment.