Skip to content

Commit

Permalink
[common] Remove asser_eq_signatures!
Browse files Browse the repository at this point in the history
Since zvariant 4's changes on `Signature as PartialEq::eq` changes, `assert_eq!`
is now sufficient.
  • Loading branch information
luukvanderduim authored and TTWNO committed Feb 23, 2024
1 parent c16c04a commit 7eee3cb
Showing 2 changed files with 3 additions and 17 deletions.
6 changes: 3 additions & 3 deletions atspi-common/src/events/mod.rs
Original file line number Diff line number Diff line change
@@ -488,7 +488,7 @@ fn test_event_listener_default_no_panic() {

#[test]
fn test_event_listener_signature() {
assert_eq_signatures!(&EventListeners::signature(), &EVENT_LISTENER_SIGNATURE);
assert_eq!(&EventListeners::signature(), &EVENT_LISTENER_SIGNATURE);
}

/// Covers both `EventListener` events.
@@ -780,12 +780,12 @@ mod tests {

#[test]
fn check_event_body_qt_signature() {
assert_eq_signatures!(&<EventBodyQT as Type>::signature(), &QSPI_EVENT_SIGNATURE);
assert_eq!(&<EventBodyQT as Type>::signature(), &QSPI_EVENT_SIGNATURE);
}

#[test]
fn check_event_body_signature() {
assert_eq_signatures!(&<EventBodyOwned as Type>::signature(), &ATSPI_EVENT_SIGNATURE);
assert_eq!(&<EventBodyOwned as Type>::signature(), &ATSPI_EVENT_SIGNATURE);
}

#[test]
14 changes: 0 additions & 14 deletions atspi-common/src/macros.rs
Original file line number Diff line number Diff line change
@@ -530,17 +530,3 @@ macro_rules! event_test_cases {
assert_impl_all!(zbus::Message: TryFrom<$type>);
};
}

/// Asserts that the signatures are equal, but ignores the outer parentheses as
/// the difference between marshalled and unmarshalled signatures is often just one set of outer parentheses.
#[macro_export]
macro_rules! assert_eq_signatures {
($lhs_sig:expr, $rhs_sig:expr) => {
assert!(
$lhs_sig == $rhs_sig,
"Signatures are not equal (Lhs: {}, Rhs: {})",
$lhs_sig,
$rhs_sig
);
};
}

0 comments on commit 7eee3cb

Please sign in to comment.