Skip to content

Commit a53c4bf

Browse files
Rollup merge of rust-lang#129640 - saethlin:unignore-android-in-alloc, r=tgross35
Re-enable android tests/benches in alloc/core This is basically a revert of rust-lang#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 :)
2 parents d11dde6 + 83de14c commit a53c4bf

File tree

5 files changed

+5
-25
lines changed

5 files changed

+5
-25
lines changed

library/alloc/benches/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// Disabling on android for the time being
2-
// See https://github.com/rust-lang/rust/issues/73535#event-3477699747
3-
#![cfg(not(target_os = "android"))]
41
// Disabling in Miri as these would take too long.
52
#![cfg(not(miri))]
63
#![feature(btree_extract_if)]

library/alloc/tests/string.rs

-3
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,6 @@ fn test_reserve_exact() {
723723

724724
#[test]
725725
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
726-
#[cfg_attr(target_os = "android", ignore)] // Android used in CI has a broken dlmalloc
727726
fn test_try_with_capacity() {
728727
let string = String::try_with_capacity(1000).unwrap();
729728
assert_eq!(0, string.len());
@@ -734,7 +733,6 @@ fn test_try_with_capacity() {
734733

735734
#[test]
736735
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
737-
#[cfg_attr(target_os = "android", ignore)] // Android used in CI has a broken dlmalloc
738736
fn test_try_reserve() {
739737
// These are the interesting cases:
740738
// * exactly isize::MAX should never trigger a CapacityOverflow (can be OOM)
@@ -803,7 +801,6 @@ fn test_try_reserve() {
803801

804802
#[test]
805803
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
806-
#[cfg_attr(target_os = "android", ignore)] // Android used in CI has a broken dlmalloc
807804
fn test_try_reserve_exact() {
808805
// This is exactly the same as test_try_reserve with the method changed.
809806
// See that test for comments.

library/alloc/tests/vec.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1695,7 +1695,6 @@ fn test_reserve_exact() {
16951695

16961696
#[test]
16971697
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
1698-
#[cfg_attr(target_os = "android", ignore)] // Android used in CI has a broken dlmalloc
16991698
fn test_try_with_capacity() {
17001699
let mut vec: Vec<u32> = Vec::try_with_capacity(5).unwrap();
17011700
assert_eq!(0, vec.len());
@@ -1707,7 +1706,6 @@ fn test_try_with_capacity() {
17071706

17081707
#[test]
17091708
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
1710-
#[cfg_attr(target_os = "android", ignore)] // Android used in CI has a broken dlmalloc
17111709
fn test_try_reserve() {
17121710
// These are the interesting cases:
17131711
// * exactly isize::MAX should never trigger a CapacityOverflow (can be OOM)
@@ -1803,7 +1801,6 @@ fn test_try_reserve() {
18031801

18041802
#[test]
18051803
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
1806-
#[cfg_attr(target_os = "android", ignore)] // Android used in CI has a broken dlmalloc
18071804
fn test_try_reserve_exact() {
18081805
// This is exactly the same as test_try_reserve with the method changed.
18091806
// See that test for comments.

library/alloc/tests/vec_deque.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,6 @@ fn test_reserve_exact_2() {
11851185

11861186
#[test]
11871187
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
1188-
#[cfg_attr(target_os = "android", ignore)] // Android used in CI has a broken dlmalloc
11891188
fn test_try_with_capacity() {
11901189
let vec: VecDeque<u32> = VecDeque::try_with_capacity(5).unwrap();
11911190
assert_eq!(0, vec.len());
@@ -1196,7 +1195,6 @@ fn test_try_with_capacity() {
11961195

11971196
#[test]
11981197
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
1199-
#[cfg_attr(target_os = "android", ignore)] // Android used in CI has a broken dlmalloc
12001198
fn test_try_reserve() {
12011199
// These are the interesting cases:
12021200
// * exactly isize::MAX should never trigger a CapacityOverflow (can be OOM)
@@ -1292,7 +1290,6 @@ fn test_try_reserve() {
12921290

12931291
#[test]
12941292
#[cfg_attr(miri, ignore)] // Miri does not support signalling OOM
1295-
#[cfg_attr(target_os = "android", ignore)] // Android used in CI has a broken dlmalloc
12961293
fn test_try_reserve_exact() {
12971294
// This is exactly the same as test_try_reserve with the method changed.
12981295
// See that test for comments.

library/core/tests/num/int_log.rs

+5-13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
//! This tests the `Integer::{ilog,log2,log10}` methods. These tests are in a
2-
//! separate file because there's both a large number of them, and not all tests
3-
//! can be run on Android. This is because in Android `ilog2` uses an imprecise
4-
//! approximation:https://github.com/rust-lang/rust/blob/4825e12fc9c79954aa0fe18f5521efa6c19c7539/src/libstd/sys/unix/android.rs#L27-L53
1+
//! Tests for the `Integer::{ilog,log2,log10}` methods.
52
63
#[test]
74
fn checked_ilog() {
@@ -48,6 +45,10 @@ fn checked_ilog2() {
4845
assert_eq!(0i8.checked_ilog2(), None);
4946
assert_eq!(0i16.checked_ilog2(), None);
5047

48+
assert_eq!(8192u16.checked_ilog2(), Some((8192f32).log2() as u32));
49+
assert_eq!(32768u16.checked_ilog2(), Some((32768f32).log2() as u32));
50+
assert_eq!(8192i16.checked_ilog2(), Some((8192f32).log2() as u32));
51+
5152
for i in 1..=u8::MAX {
5253
assert_eq!(i.checked_ilog2(), Some((i as f32).log2() as u32), "checking {i}");
5354
}
@@ -77,15 +78,6 @@ fn checked_ilog2() {
7778
}
7879
}
7980

80-
// Validate cases that fail on Android's imprecise float ilog2 implementation.
81-
#[test]
82-
#[cfg(not(target_os = "android"))]
83-
fn checked_ilog2_not_android() {
84-
assert_eq!(8192u16.checked_ilog2(), Some((8192f32).log2() as u32));
85-
assert_eq!(32768u16.checked_ilog2(), Some((32768f32).log2() as u32));
86-
assert_eq!(8192i16.checked_ilog2(), Some((8192f32).log2() as u32));
87-
}
88-
8981
#[test]
9082
fn checked_ilog10() {
9183
assert_eq!(0u8.checked_ilog10(), None);

0 commit comments

Comments
 (0)