Skip to content

Commit 59bb0fe

Browse files
committed
Fix align_offset_stride1 & align_to_simple tests
1 parent 6d5bf8b commit 59bb0fe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/libcore/tests/ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,8 @@ fn align_offset_stride1() {
322322
let offset = if expected == 0 { 0 } else { align - expected };
323323
assert_eq!((ptr as *const u8).align_offset(align), offset,
324324
"ptr = {}, align = {}, size = 1", ptr, align);
325-
align = (align + 1).next_power_of_two();
326325
}
326+
align = (align + 1).next_power_of_two();
327327
}
328328
}
329329

src/libcore/tests/slice.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ fn test_align_to_simple() {
821821
assert!(prefix == [1] || suffix == [7]);
822822
let expect1 = [1 << 8 | 2, 3 << 8 | 4, 5 << 8 | 6];
823823
let expect2 = [1 | 2 << 8, 3 | 4 << 8, 5 | 6 << 8];
824-
let expect3 = [2 | 3 << 8, 4 | 5 << 8, 6 | 7 << 8];
824+
let expect3 = [2 << 8 | 3, 4 << 8 | 5, 6 << 8 | 7];
825825
let expect4 = [2 | 3 << 8, 4 | 5 << 8, 6 | 7 << 8];
826826
assert!(aligned == expect1 || aligned == expect2 || aligned == expect3 || aligned == expect4,
827827
"aligned={:?} expected={:?} || {:?} || {:?} || {:?}",

0 commit comments

Comments
 (0)