Skip to content

Commit 98381ac

Browse files
Basic test for dynamic subscriptions graph
Signed-off-by: Luca Della Vedova <[email protected]>
1 parent 60a542a commit 98381ac

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

rclrs/src/dynamic_message/dynamic_subscription.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -383,20 +383,24 @@ mod tests {
383383
let namespace = "/test_dynamic_subscriptions_graph";
384384
let graph = construct_test_graph(namespace)?;
385385

386-
let node_2_empty_subscription = graph
387-
.node2
388-
.create_dynamic_subscription::<_>("test_msgs/msg/Empty".try_into().unwrap(), "graph_test_topic_1", |_, _| {})?;
386+
let node_2_empty_subscription = graph.node2.create_dynamic_subscription::<_>(
387+
"test_msgs/msg/Empty".try_into().unwrap(),
388+
"graph_test_topic_1",
389+
|_, _| {},
390+
)?;
389391
let topic1 = node_2_empty_subscription.topic_name();
390-
/*
391392
let node_2_basic_types_subscription =
392-
graph.node2.create_subscription::<msg::BasicTypes, _>(
393+
graph.node2.create_dynamic_subscription::<_>(
394+
"test_msgs/msg/BasicTypes".try_into().unwrap(),
393395
"graph_test_topic_2",
394-
|_msg: msg::BasicTypes| {},
396+
|_, _| {},
395397
)?;
396398
let topic2 = node_2_basic_types_subscription.topic_name();
397-
let node_1_defaults_subscription = graph.node1.create_subscription::<msg::Defaults, _>(
399+
400+
let node_1_defaults_subscription = graph.node1.create_dynamic_subscription::<_>(
401+
"test_msgs/msg/Defaults".try_into().unwrap(),
398402
"graph_test_topic_3",
399-
|_msg: msg::Defaults| {},
403+
|_, _| {},
400404
)?;
401405
let topic3 = node_1_defaults_subscription.topic_name();
402406

@@ -438,7 +442,6 @@ mod tests {
438442
graph.node2.get_subscriptions_info_by_topic(&topic1)?,
439443
expected_subscriptions_info
440444
);
441-
*/
442445
Ok(())
443446
}
444447
}

0 commit comments

Comments
 (0)