Skip to content

Commit 868020e

Browse files
committed
Consolidate one tests
1 parent fc01eed commit 868020e

File tree

5 files changed

+19
-52
lines changed

5 files changed

+19
-52
lines changed

library/coretests/tests/floats/f128.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,6 @@ const NAN_MASK2: u128 = 0x00005555555555555555555555555555;
4040
// FIXME(f16_f128,miri): many of these have to be disabled since miri does not yet support
4141
// the intrinsics.
4242

43-
#[test]
44-
fn test_one() {
45-
let one: f128 = 1.0f128;
46-
assert_biteq!(1.0, one);
47-
assert!(!one.is_infinite());
48-
assert!(one.is_finite());
49-
assert!(one.is_sign_positive());
50-
assert!(!one.is_sign_negative());
51-
assert!(!one.is_nan());
52-
assert!(one.is_normal());
53-
assert_eq!(Fp::Normal, one.classify());
54-
}
55-
5643
#[test]
5744
fn test_is_nan() {
5845
let nan: f128 = f128::NAN;

library/coretests/tests/floats/f16.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,6 @@ const NAN_MASK2: u16 = 0x0155;
4646
// FIXME(f16_f128,miri): many of these have to be disabled since miri does not yet support
4747
// the intrinsics.
4848

49-
#[test]
50-
fn test_one() {
51-
let one: f16 = 1.0f16;
52-
assert_biteq!(1.0, one);
53-
assert!(!one.is_infinite());
54-
assert!(one.is_finite());
55-
assert!(one.is_sign_positive());
56-
assert!(!one.is_sign_negative());
57-
assert!(!one.is_nan());
58-
assert!(one.is_normal());
59-
assert_eq!(Fp::Normal, one.classify());
60-
}
61-
6249
#[test]
6350
fn test_is_nan() {
6451
let nan: f16 = f16::NAN;

library/coretests/tests/floats/f32.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,6 @@ const NAN_MASK2: u32 = 0x0055_5555;
3030
/// They serve as a way to get an idea of the real precision of floating point operations on different platforms.
3131
const APPROX_DELTA: f32 = if cfg!(miri) { 1e-4 } else { 1e-6 };
3232

33-
#[test]
34-
fn test_one() {
35-
let one: f32 = 1.0f32;
36-
assert_biteq!(1.0, one);
37-
assert!(!one.is_infinite());
38-
assert!(one.is_finite());
39-
assert!(one.is_sign_positive());
40-
assert!(!one.is_sign_negative());
41-
assert!(!one.is_nan());
42-
assert!(one.is_normal());
43-
assert_eq!(Fp::Normal, one.classify());
44-
}
45-
4633
#[test]
4734
fn test_is_nan() {
4835
let nan: f32 = f32::NAN;

library/coretests/tests/floats/f64.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,6 @@ const NAN_MASK1: u64 = 0x000a_aaaa_aaaa_aaaa;
2525
/// Second pattern over the mantissa
2626
const NAN_MASK2: u64 = 0x0005_5555_5555_5555;
2727

28-
#[test]
29-
fn test_one() {
30-
let one: f64 = 1.0f64;
31-
assert_biteq!(1.0, one);
32-
assert!(!one.is_infinite());
33-
assert!(one.is_finite());
34-
assert!(one.is_sign_positive());
35-
assert!(!one.is_sign_negative());
36-
assert!(!one.is_nan());
37-
assert!(one.is_normal());
38-
assert_eq!(Fp::Normal, one.classify());
39-
}
40-
4128
#[test]
4229
fn test_is_nan() {
4330
let nan: f64 = f64::NAN;

library/coretests/tests/floats/mod.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,25 @@ float_test! {
361361
}
362362
}
363363

364+
float_test! {
365+
name: one,
366+
attrs: {
367+
f16: #[cfg(any(miri, target_has_reliable_f16))],
368+
f128: #[cfg(any(miri, target_has_reliable_f128))],
369+
},
370+
test<Float> {
371+
let one: Float = 1.0;
372+
assert_biteq!(1.0, one);
373+
assert!(!one.is_infinite());
374+
assert!(one.is_finite());
375+
assert!(one.is_sign_positive());
376+
assert!(!one.is_sign_negative());
377+
assert!(!one.is_nan());
378+
assert!(one.is_normal());
379+
assert!(matches!(one.classify(), Fp::Normal));
380+
}
381+
}
382+
364383
float_test! {
365384
name: min,
366385
attrs: {

0 commit comments

Comments
 (0)