1
1
//! Compare the results of the `libm` implementation against the system's libm.
2
2
#![ cfg( test) ]
3
- #![ cfg( feature = "system_libm" ) ]
3
+ // #![cfg(feature = "system_libm")]
4
4
5
5
use libm_test:: WithinUlps ;
6
6
@@ -89,7 +89,7 @@ macro_rules! system_libm {
89
89
}
90
90
91
91
// Generate a tuple of arguments containing random values:
92
- let mut args: ( $( $arg_tys) , + ) = ( $( <$arg_tys as Rand >:: gen ( & mut rng) ) , + ) ;
92
+ let mut args: ( $( $arg_tys, ) + ) = ( $( <$arg_tys as Rand >:: gen ( & mut rng) , ) + ) ;
93
93
94
94
// HACK
95
95
if let "j1" | "jn" = stringify!( $id) {
@@ -104,7 +104,7 @@ macro_rules! system_libm {
104
104
let result = args. call( libm_fn as FnTy ) ;
105
105
let expected = args. call( $id as FnTy ) ;
106
106
if !result. within_ulps( expected, ULP_TOL ) {
107
- eprintln!( "result = {:?} != {:?} (expected)" , result, expected) ;
107
+ eprintln!( "{}{:?} returns = {:?} != {:?} (expected)" , stringify! ( $id ) , args , result, expected) ;
108
108
panic!( ) ;
109
109
}
110
110
}
@@ -128,7 +128,7 @@ trait Call<F> {
128
128
macro_rules! impl_call {
129
129
( ( $( $arg_tys: ty) ,* ) -> $ret_ty: ty: $self_: ident: $( $xs: expr) ,* ) => {
130
130
// We only care about unsafe extern "C" functions here, safe functions coerce to them:
131
- impl Call <unsafe extern"C" fn ( $( $arg_tys) ,* ) -> $ret_ty> for ( $( $arg_tys) , +) {
131
+ impl Call <unsafe extern"C" fn ( $( $arg_tys) ,* ) -> $ret_ty> for ( $( $arg_tys, ) +) {
132
132
type Ret = $ret_ty;
133
133
fn call( self , f: unsafe extern "C" fn ( $( $arg_tys) ,* ) -> $ret_ty) -> Self :: Ret {
134
134
let $self_ = self ;
@@ -138,10 +138,10 @@ macro_rules! impl_call {
138
138
} ;
139
139
}
140
140
141
- impl_call ! ( ( f32 ) -> f32 : x: x) ;
142
- impl_call ! ( ( f64 ) -> f64 : x: x) ;
143
- impl_call ! ( ( f64 ) -> i32 : x: x) ;
144
- impl_call ! ( ( f32 ) -> i32 : x: x) ;
141
+ impl_call ! ( ( f32 ) -> f32 : x: x. 0 ) ;
142
+ impl_call ! ( ( f64 ) -> f64 : x: x. 0 ) ;
143
+ impl_call ! ( ( f64 ) -> i32 : x: x. 0 ) ;
144
+ impl_call ! ( ( f32 ) -> i32 : x: x. 0 ) ;
145
145
impl_call ! ( ( f32 , f32 ) -> f32 : x: x. 0 , x. 1 ) ;
146
146
impl_call ! ( ( f64 , f64 ) -> f64 : x: x. 0 , x. 1 ) ;
147
147
impl_call ! ( ( f64 , i32 ) -> f64 : x: x. 0 , x. 1 ) ;
0 commit comments