Rollup merge of #129640 - saethlin:unignore-android-in-alloc, r=tgross35
Re-enable android tests/benches in alloc/core This is basically a revert of https://github.com/rust-lang/rust/pull/73729. These tests better work on android now; it's been 4 years and we don't use dlmalloc on that target anymore. And I've validated that they should pass now with a try-build :)
This commit is contained in:
commit
385ffaedbf
5 changed files with 5 additions and 25 deletions
|
@ -1,6 +1,3 @@
|
|||
// Disabling on android for the time being
|
||||
// See https://github.com/rust-lang/rust/issues/73535#event-3477699747
|
||||
#![cfg(not(target_os = "android"))]
|
||||
// Disabling in Miri as these would take too long.
|
||||
#![cfg(not(miri))]
|
||||
#![feature(btree_extract_if)]
|
||||
|
|
|
@ -723,7 +723,6 @@ fn test_reserve_exact() {
|
|||
|
||||
#[test]
|
||||
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
|
||||
#[cfg_attr(target_os = "android", ignore)] // Android used in CI has a broken dlmalloc
|
||||
fn test_try_with_capacity() {
|
||||
let string = String::try_with_capacity(1000).unwrap();
|
||||
assert_eq!(0, string.len());
|
||||
|
@ -734,7 +733,6 @@ fn test_try_with_capacity() {
|
|||
|
||||
#[test]
|
||||
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
|
||||
#[cfg_attr(target_os = "android", ignore)] // Android used in CI has a broken dlmalloc
|
||||
fn test_try_reserve() {
|
||||
// These are the interesting cases:
|
||||
// * exactly isize::MAX should never trigger a CapacityOverflow (can be OOM)
|
||||
|
@ -803,7 +801,6 @@ fn test_try_reserve() {
|
|||
|
||||
#[test]
|
||||
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
|
||||
#[cfg_attr(target_os = "android", ignore)] // Android used in CI has a broken dlmalloc
|
||||
fn test_try_reserve_exact() {
|
||||
// This is exactly the same as test_try_reserve with the method changed.
|
||||
// See that test for comments.
|
||||
|
|
|
@ -1695,7 +1695,6 @@ fn test_reserve_exact() {
|
|||
|
||||
#[test]
|
||||
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
|
||||
#[cfg_attr(target_os = "android", ignore)] // Android used in CI has a broken dlmalloc
|
||||
fn test_try_with_capacity() {
|
||||
let mut vec: Vec<u32> = Vec::try_with_capacity(5).unwrap();
|
||||
assert_eq!(0, vec.len());
|
||||
|
@ -1707,7 +1706,6 @@ fn test_try_with_capacity() {
|
|||
|
||||
#[test]
|
||||
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
|
||||
#[cfg_attr(target_os = "android", ignore)] // Android used in CI has a broken dlmalloc
|
||||
fn test_try_reserve() {
|
||||
// These are the interesting cases:
|
||||
// * exactly isize::MAX should never trigger a CapacityOverflow (can be OOM)
|
||||
|
@ -1803,7 +1801,6 @@ fn test_try_reserve() {
|
|||
|
||||
#[test]
|
||||
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
|
||||
#[cfg_attr(target_os = "android", ignore)] // Android used in CI has a broken dlmalloc
|
||||
fn test_try_reserve_exact() {
|
||||
// This is exactly the same as test_try_reserve with the method changed.
|
||||
// See that test for comments.
|
||||
|
|
|
@ -1185,7 +1185,6 @@ fn test_reserve_exact_2() {
|
|||
|
||||
#[test]
|
||||
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
|
||||
#[cfg_attr(target_os = "android", ignore)] // Android used in CI has a broken dlmalloc
|
||||
fn test_try_with_capacity() {
|
||||
let vec: VecDeque<u32> = VecDeque::try_with_capacity(5).unwrap();
|
||||
assert_eq!(0, vec.len());
|
||||
|
@ -1196,7 +1195,6 @@ fn test_try_with_capacity() {
|
|||
|
||||
#[test]
|
||||
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
|
||||
#[cfg_attr(target_os = "android", ignore)] // Android used in CI has a broken dlmalloc
|
||||
fn test_try_reserve() {
|
||||
// These are the interesting cases:
|
||||
// * exactly isize::MAX should never trigger a CapacityOverflow (can be OOM)
|
||||
|
@ -1292,7 +1290,6 @@ fn test_try_reserve() {
|
|||
|
||||
#[test]
|
||||
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
|
||||
#[cfg_attr(target_os = "android", ignore)] // Android used in CI has a broken dlmalloc
|
||||
fn test_try_reserve_exact() {
|
||||
// This is exactly the same as test_try_reserve with the method changed.
|
||||
// See that test for comments.
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
//! This tests the `Integer::{ilog,log2,log10}` methods. These tests are in a
|
||||
//! separate file because there's both a large number of them, and not all tests
|
||||
//! can be run on Android. This is because in Android `ilog2` uses an imprecise
|
||||
//! approximation:https://github.com/rust-lang/rust/blob/4825e12fc9c79954aa0fe18f5521efa6c19c7539/src/libstd/sys/unix/android.rs#L27-L53
|
||||
//! Tests for the `Integer::{ilog,log2,log10}` methods.
|
||||
|
||||
#[test]
|
||||
fn checked_ilog() {
|
||||
|
@ -48,6 +45,10 @@ fn checked_ilog2() {
|
|||
assert_eq!(0i8.checked_ilog2(), None);
|
||||
assert_eq!(0i16.checked_ilog2(), None);
|
||||
|
||||
assert_eq!(8192u16.checked_ilog2(), Some((8192f32).log2() as u32));
|
||||
assert_eq!(32768u16.checked_ilog2(), Some((32768f32).log2() as u32));
|
||||
assert_eq!(8192i16.checked_ilog2(), Some((8192f32).log2() as u32));
|
||||
|
||||
for i in 1..=u8::MAX {
|
||||
assert_eq!(i.checked_ilog2(), Some((i as f32).log2() as u32), "checking {i}");
|
||||
}
|
||||
|
@ -77,15 +78,6 @@ fn checked_ilog2() {
|
|||
}
|
||||
}
|
||||
|
||||
// Validate cases that fail on Android's imprecise float ilog2 implementation.
|
||||
#[test]
|
||||
#[cfg(not(target_os = "android"))]
|
||||
fn checked_ilog2_not_android() {
|
||||
assert_eq!(8192u16.checked_ilog2(), Some((8192f32).log2() as u32));
|
||||
assert_eq!(32768u16.checked_ilog2(), Some((32768f32).log2() as u32));
|
||||
assert_eq!(8192i16.checked_ilog2(), Some((8192f32).log2() as u32));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn checked_ilog10() {
|
||||
assert_eq!(0u8.checked_ilog10(), None);
|
||||
|
|
Loading…
Add table
Reference in a new issue