mirror of https://github.com/status-im/evmc.git
Add struct size/alignment tests to Rust
This commit is contained in:
parent
8eac50424e
commit
f721642851
|
@ -35,3 +35,19 @@ impl Default for evmc_bytes32 {
|
|||
evmc_bytes32 { bytes: [0u8; 32] }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::mem::size_of;
|
||||
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn container_new() {
|
||||
// TODO: add other checks from test/unittests/test_helpers.cpp
|
||||
assert_eq!(size_of::<evmc_bytes32>(), 32);
|
||||
assert_eq!(size_of::<evmc_address>(), 20);
|
||||
assert!(size_of::<evmc_result>() <= 64);
|
||||
assert!(size_of::<evmc_vm>() <= 64);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue