mirror of
https://github.com/chatmail/core.git
synced 2026-04-19 14:36:29 +03:00
Add explicit tests for special ContactId values
Turns out some FFI users don't use the constants. Scary.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user