Add tests for from_bits.
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
This commit is contained in:
parent
24ece07cec
commit
de2c48c30a
1 changed files with 7 additions and 0 deletions
|
|
@ -207,6 +207,13 @@ mod tests {
|
|||
assert_eq!(FlagABC.bits(), 0x00000111);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_from_bits() {
|
||||
assert!(unsafe { Flags::from_bits(0x00000000) } == Flags::empty());
|
||||
assert!(unsafe { Flags::from_bits(0x00000001) } == FlagA);
|
||||
assert!(unsafe { Flags::from_bits(0x00000111) } == FlagABC);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_is_empty(){
|
||||
assert!(Flags::empty().is_empty());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue