Skip to content

Commit 0ccf276

Browse files
committed
Enable some ilog2 tests as well
1 parent b2baccc commit 0ccf276

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

library/core/tests/num/int_log.rs

+2-7
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() {
@@ -77,10 +74,8 @@ fn checked_ilog2() {
7774
}
7875
}
7976

80-
// Validate cases that fail on Android's imprecise float ilog2 implementation.
8177
#[test]
82-
#[cfg(not(target_os = "android"))]
83-
fn checked_ilog2_not_android() {
78+
fn checked_ilog2() {
8479
assert_eq!(8192u16.checked_ilog2(), Some((8192f32).log2() as u32));
8580
assert_eq!(32768u16.checked_ilog2(), Some((32768f32).log2() as u32));
8681
assert_eq!(8192i16.checked_ilog2(), Some((8192f32).log2() as u32));

0 commit comments

Comments
 (0)