Skip to content

Commit

Permalink
Fix align_offset_stride1 & align_to_simple tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nagisa committed May 17, 2018
1 parent 6d5bf8b commit 59bb0fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/libcore/tests/ptr.rs
Expand Up @@ -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();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/libcore/tests/slice.rs
Expand Up @@ -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={:?} || {:?} || {:?} || {:?}",
Expand Down

0 comments on commit 59bb0fe

Please sign in to comment.