Skip to content

Commit

Permalink
Generalise pointer width tests using pointer_width
Browse files Browse the repository at this point in the history
  • Loading branch information
richo committed Jan 14, 2015
1 parent 043a4b3 commit c513793
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions src/libcoretest/mem.rs
Expand Up @@ -19,19 +19,14 @@ fn size_of_basic() {
}

#[test]
#[cfg(any(target_arch = "x86",
target_arch = "arm",
target_arch = "mips",
target_arch = "mipsel",
target_arch = "powerpc"))]
#[cfg(target_pointer_width = "32")]
fn size_of_32() {
assert_eq!(size_of::<uint>(), 4u);
assert_eq!(size_of::<*const uint>(), 4u);
}

#[test]
#[cfg(any(target_arch = "x86_64",
target_arch = "aarch64"))]
#[cfg(target_pointer_width = "64")]
fn size_of_64() {
assert_eq!(size_of::<uint>(), 8u);
assert_eq!(size_of::<*const uint>(), 8u);
Expand All @@ -53,19 +48,14 @@ fn align_of_basic() {
}

#[test]
#[cfg(any(target_arch = "x86",
target_arch = "arm",
target_arch = "mips",
target_arch = "mipsel",
target_arch = "powerpc"))]
#[cfg(target_pointer_width = "32")]
fn align_of_32() {
assert_eq!(align_of::<uint>(), 4u);
assert_eq!(align_of::<*const uint>(), 4u);
}

#[test]
#[cfg(any(target_arch = "x86_64",
target_arch = "aarch64"))]
#[cfg(target_pointer_width = "64")]
fn align_of_64() {
assert_eq!(align_of::<uint>(), 8u);
assert_eq!(align_of::<*const uint>(), 8u);
Expand Down

0 comments on commit c513793

Please sign in to comment.