#[cfg(target_pointer_width = "64")]
mod identifier_sizes {
use rubo4e::identifiers::*;
use std::mem::size_of;
const BOX_STR: usize = 16;
#[test]
fn malo_id_size() {
assert_eq!(size_of::<MaloId>(), BOX_STR, "MaloId should be 16 bytes");
}
#[test]
fn melo_id_size() {
assert_eq!(size_of::<MeloId>(), BOX_STR, "MeloId should be 16 bytes");
}
#[test]
fn nelo_id_size() {
assert_eq!(size_of::<NeloId>(), BOX_STR, "NeloId should be 16 bytes");
}
#[test]
fn sr_id_size() {
assert_eq!(size_of::<SrId>(), BOX_STR, "SrId should be 16 bytes");
}
#[test]
fn tr_id_size() {
assert_eq!(size_of::<TrId>(), BOX_STR, "TrId should be 16 bytes");
}
#[test]
fn eic_code_size() {
assert_eq!(size_of::<EicCode>(), BOX_STR, "EicCode should be 16 bytes");
}
#[test]
fn obis_code_size() {
assert_eq!(
size_of::<ObisCode>(),
BOX_STR,
"ObisCode should be 16 bytes"
);
}
#[test]
fn marktpartner_id_size() {
assert_eq!(
size_of::<MarktpartnerId>(),
BOX_STR,
"MarktpartnerId should be 16 bytes"
);
}
}
#[cfg(all(target_pointer_width = "64", feature = "versioned", feature = "serde"))]
mod generated_type_sizes {
use rubo4e::v202501::*;
use std::mem::size_of;
#[test]
fn bo_typ_size() {
assert_eq!(
size_of::<BoTyp>(),
1,
"BoTyp is a fieldless enum and should be 1 byte"
);
}
#[test]
fn option_bo_typ_size() {
assert!(
size_of::<Option<BoTyp>>() <= 2,
"Option<BoTyp> should fit in 2 bytes (niche opt), got {}",
size_of::<Option<BoTyp>>()
);
}
}