diff --git a/src/contact.rs b/src/contact.rs index 4c4eb3058..9f10db254 100644 --- a/src/contact.rs +++ b/src/contact.rs @@ -1479,6 +1479,17 @@ mod tests { use crate::message::Message; use crate::test_utils::{self, TestContext}; + #[test] + fn test_contact_id_values() { + // Some FFI users need to have the values of these fixed, how naughty. But let's + // make sure we don't modify them anyway. + assert_eq!(ContactId::UNDEFINED.to_u32(), 0); + assert_eq!(ContactId::SELF.to_u32(), 1); + assert_eq!(ContactId::INFO.to_u32(), 2); + assert_eq!(ContactId::DEVICE.to_u32(), 5); + assert_eq!(ContactId::LAST_SPECIAL.to_u32(), 9); + } + #[test] fn test_may_be_valid_addr() { assert_eq!(may_be_valid_addr(""), false);