Closed rhbvkleef closed 1 year ago
When altering dbus-crossroads/test.rs the following way, the test fails, while it should succeed:
dbus-crossroads/test.rs
diff --git a/dbus-crossroads/src/test.rs b/dbus-crossroads/src/test.rs index 2670afa..36963da 100644 --- a/dbus-crossroads/src/test.rs +++ b/dbus-crossroads/src/test.rs @@ -114,6 +114,7 @@ const INTROSPECT: &str = r###"<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS O <arg name="new_value" type="b"/> </signal> <property name="Bar" type="y" access="readwrite"/> + <annotation name="com.example.SampleAnnotation" value="TestValue"/> </interface> <interface name="org.freedesktop.DBus.Introspectable"> <method name="Introspect"> @@ -163,6 +164,7 @@ fn introspect() { }); b.signal::<(bool,), _>("Changed", ("new_value",)); b.property("Bar").get(|_,_| Ok(0u8)).set(|_,_,_| Ok(None)); + b.annotate("com.example.SampleAnnotation", "TestValue"); }); cr.insert("/com/example/sample_object0", &[token], ()); cr.insert("/com/example/sample_object0/child_of_sample_object", &[], ());
This change fixes the problem:
diff --git a/dbus-crossroads/src/ifacedesc.rs b/dbus-crossroads/src/ifacedesc.rs index ceb3142..f973853 100644 --- a/dbus-crossroads/src/ifacedesc.rs +++ b/dbus-crossroads/src/ifacedesc.rs @@ -116,7 +120,7 @@ impl Registry { r += &format!(">\n{} </property>\n", x.annotations.introspect(" ")); } } - desc.annotations.introspect(" "); + r += &desc.annotations.introspect(" "); r += " </interface>\n"; }; r
When altering
dbus-crossroads/test.rs
the following way, the test fails, while it should succeed:This change fixes the problem: