Skip to content

Commit 06556e6

Browse files
authored
Avoid short-circuit in policy checking (#4)
* Small improvement to avoid short-circuit * Updated test expected
1 parent f21c5bd commit 06556e6

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

examples/evaluation/detectable-142456.rospec

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
policy instance depth5qos: qos {
2-
setting history = KeepLast;
1+
policy instance best_effort_qos5: qos {
32
setting depth = 5;
3+
setting reliability = BestEffort;
44
}
55

6-
policy instance depth1qos: qos {
7-
setting history = KeepLast;
8-
setting depth = 1;
6+
policy instance reliable_qos5: qos {
7+
setting depth = 5;
8+
setting reliability = Reliable;
99
}
1010

1111
policy instance RGB8: color_format {
@@ -19,13 +19,13 @@ policy instance Grayscale: color_format {
1919
node type openni_camera_driver_depth_type {
2020
optional param depth_registration: bool = true;
2121

22-
@qos{depth1qos}
22+
@qos{best_effort_qos5}
2323
@color_format{Grayscale}
2424
publishes to /camera/rgb/image_raw: sensor_msgs/Image;
2525
}
2626

2727
node type custom_node_type {
28-
@qos{depth5qos}
28+
@qos{reliable_qos5}
2929
@color_format{RGB8}
3030
subscribes to /camera/rgb/image_raw: sensor_msgs/Image;
3131
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
QoS rule reliability not satisfied: Reliable !< BestEffort
2+
QoS rules not satisfied for subscriber and publisher
13
Color format not satisfied: RGB8 != Grayscale

src/rospec/verification/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def check_policies(
218218

219219
result = True
220220
for name in consumer_policy.keys():
221-
result = result and dispatcher[name](context, consumer_policy[name], provider_policy[name])
221+
result = dispatcher[name](context, consumer_policy[name], provider_policy[name]) and result
222222

223223
return result
224224

0 commit comments

Comments
 (0)