Fix align_offset_stride1 & align_to_simple tests
This commit is contained in:
parent
6d5bf8b23f
commit
59bb0fe66e
2 changed files with 2 additions and 2 deletions
|
@ -322,8 +322,8 @@ fn align_offset_stride1() {
|
|||
let offset = if expected == 0 { 0 } else { align - expected };
|
||||
assert_eq!((ptr as *const u8).align_offset(align), offset,
|
||||
"ptr = {}, align = {}, size = 1", ptr, align);
|
||||
align = (align + 1).next_power_of_two();
|
||||
}
|
||||
align = (align + 1).next_power_of_two();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -821,7 +821,7 @@ fn test_align_to_simple() {
|
|||
assert!(prefix == [1] || suffix == [7]);
|
||||
let expect1 = [1 << 8 | 2, 3 << 8 | 4, 5 << 8 | 6];
|
||||
let expect2 = [1 | 2 << 8, 3 | 4 << 8, 5 | 6 << 8];
|
||||
let expect3 = [2 | 3 << 8, 4 | 5 << 8, 6 | 7 << 8];
|
||||
let expect3 = [2 << 8 | 3, 4 << 8 | 5, 6 << 8 | 7];
|
||||
let expect4 = [2 | 3 << 8, 4 | 5 << 8, 6 | 7 << 8];
|
||||
assert!(aligned == expect1 || aligned == expect2 || aligned == expect3 || aligned == expect4,
|
||||
"aligned={:?} expected={:?} || {:?} || {:?} || {:?}",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue