use thorium::color::*; #[test] #[allow(non_snake_case)] fn test_ARGB32_field_ordering() { let b = ARGB32 { a: 0, r: 0, g: 0, b: 0xFF, }; let b32 = 0x0000_00FF; let b_transmute = unsafe { core::mem::transmute::(b) }; assert_eq!(b32, b_transmute); let g = ARGB32 { a: 0, r: 0, g: 0xFF, b: 0, }; let g32 = 0x0000_FF00; let g_transmute = unsafe { core::mem::transmute::(g) }; assert_eq!(g32, g_transmute); let r = ARGB32 { a: 0, r: 0xFF, g: 0, b: 0, }; let r32 = 0x00FF_0000; let r_transmute = unsafe { core::mem::transmute::(r) }; assert_eq!(r32, r_transmute); let a = ARGB32 { a: 0xFF, r: 0, g: 0, b: 0, }; let a32 = 0xFF00_0000; let a_transmute = unsafe { core::mem::transmute::(a) }; assert_eq!(a32, a_transmute); }