Skip to content

Commit 0bf6a05

Browse files
committed
Update tests
1 parent da6c836 commit 0bf6a05

14 files changed

Lines changed: 40 additions & 16 deletions

‎tests/unit/out/refcount/fft.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ pub fn fft_3(a: Ptr<Option<Value<Box<[Complex]>>>>, mut N: i32) -> Option<Value<
5656
)));
5757
let mut i: i32 = 0;
5858
'loop_: while (i < N) {
59-
let mut alpha: f64 = ((((-2_i32 as f64) * 3.141592654E+0) * (i as f64)) / (N as f64));
59+
let mut alpha: f64 =
60+
((((-2_i32 as f64) * 3.1415926535897931E+0) * (i as f64)) / (N as f64));
6061
let __rhs = Complex {
6162
re: alpha.cos(),
6263
img: alpha.sin(),

‎tests/unit/out/refcount/reinterpret_cast_double.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn main_0() -> i32 {
1515
let mut bits: Ptr<u64> = (d.as_pointer()).reinterpret_cast::<u64>();
1616
assert!(((bits.read()) == 4607182418800017408_u64));
1717
bits.write(4614256656552045848_u64);
18-
assert!(((*d.borrow()) > 3.14E+0) && ((*d.borrow()) < 3.15E+0));
18+
assert!(((*d.borrow()) > 3.1400000000000001E+0) && ((*d.borrow()) < 3.1499999999999999E+0));
1919
return 0;
2020
}
2121
pub fn __cpp2rust_init_globals() {}

‎tests/unit/out/refcount/snprintf.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ fn main_0() -> i32 {
115115
((({
116116
let __s = libcc2rs::format_c(
117117
&Ptr::<i8>::from_string_literal(b"%.2f").to_rust_string(),
118-
&[(3.14159E+0).into()],
118+
&[(3.1415899999999999E+0).into()],
119119
);
120120
let __b = __s.as_bytes();
121121
if ::std::mem::size_of::<[i8; 32]>() > 0 {
@@ -371,7 +371,7 @@ fn main_0() -> i32 {
371371
((({
372372
let __s = libcc2rs::format_c(
373373
&(fmt.as_pointer() as Ptr<i8>).to_rust_string(),
374-
&[(3.26E+0).into()],
374+
&[(3.2599999999999998E+0).into()],
375375
);
376376
let __b = __s.as_bytes();
377377
if ::std::mem::size_of::<[i8; 32]>() > 0 {

‎tests/unit/out/refcount/stdmin_fpoint.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn main() {
1111
std::process::exit(main_0());
1212
}
1313
fn main_0() -> i32 {
14-
let a0: Value<f64> = Rc::new(RefCell::new(3.14E+0));
14+
let a0: Value<f64> = Rc::new(RefCell::new(3.1400000000000001E+0));
1515
let a1: Value<f64> = Rc::new(RefCell::new(2.71E+0));
1616
if a0.as_pointer().read() <= a1.as_pointer().read() {
1717
a0.as_pointer()

‎tests/unit/out/refcount/types.rs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ fn main_0() -> i32 {
4040
== 352_u64)
4141
);
4242
assert!(((xld * 2_f64) == 3_f64));
43+
let mut pi: f64 = 3.14159265358979E+0;
44+
assert!((pi < 3.1415926540000001E+0));
45+
let mut dmax: f64 = -1.7976931348623157E+308;
46+
assert!((dmax < -1.0E+308));
47+
let mut ldmax: f64 = f64::INFINITY;
48+
assert!((ldmax > 1.7976931348623157E+308));
4349
assert!(((((xwc + (xc8 as i32)) + (xc16 as i32)) as u32).wrapping_add(xc32) == 266_u32));
4450
assert!((AnyPtr::default()).is_null());
4551
return 0;

‎tests/unit/out/refcount/union_basic.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ fn main_0() -> i32 {
5353
&(*e.borrow_mut());
5454
basic::i(u.as_pointer()).write(42);
5555
assert!(((basic::i(u.as_pointer()).read()) == 42));
56-
basic::f(u.as_pointer()).write(3.140000105E+0);
57-
assert!(((basic::f(u.as_pointer()).read()) == 3.140000105E+0));
56+
basic::f(u.as_pointer()).write(3.1400001E+0);
57+
assert!(((basic::f(u.as_pointer()).read()) == 3.1400001E+0));
5858
let buf: Value<Box<[u8]>> = Rc::new(RefCell::new((0..4).map(|_| 0_u8).collect::<Box<[u8]>>()));
5959
{
6060
((buf.as_pointer() as Ptr<u8>) as Ptr<u8>)

‎tests/unit/out/refcount/va_arg_mixed_types.rs‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ fn main_0() -> i32 {
6363
(((({
6464
sum_mixed_0(
6565
2,
66-
&[(1).into(), (3.7E+0).into(), (2).into(), (100_i64).into()],
66+
&[
67+
(1).into(),
68+
(3.7000000000000002E+0).into(),
69+
(2).into(),
70+
(100_i64).into(),
71+
],
6772
)
6873
}) == 103) as i32)
6974
!= 0)

‎tests/unit/out/unsafe/fft.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ pub unsafe fn fft_3(a: *mut Option<Box<[Complex]>>, mut N: i32) -> Option<Box<[C
5353
);
5454
let mut i: i32 = 0;
5555
'loop_: while ((i) < (N)) {
56-
let mut alpha: f64 = ((((-2_i32 as f64) * (3.141592654E+0)) * (i as f64)) / (N as f64));
56+
let mut alpha: f64 =
57+
((((-2_i32 as f64) * (3.1415926535897931E+0)) * (i as f64)) / (N as f64));
5758
w.as_mut().unwrap()[(i as usize)] = Complex {
5859
re: alpha.cos(),
5960
img: alpha.sin(),

‎tests/unit/out/unsafe/reinterpret_cast_double.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ unsafe fn main_0() -> i32 {
1717
let mut bits: *mut u64 = ((&mut d as *mut f64) as *mut u64);
1818
assert!(((*bits) == (4607182418800017408_u64)));
1919
(*bits) = 4614256656552045848_u64;
20-
assert!(((d) > (3.14E+0)) && ((d) < (3.15E+0)));
20+
assert!(((d) > (3.1400000000000001E+0)) && ((d) < (3.1499999999999999E+0)));
2121
return 0;
2222
}
2323
pub unsafe fn __cpp2rust_init_globals() {}

‎tests/unit/out/unsafe/snprintf.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ unsafe fn main_0() -> i32 {
7777
buf.as_mut_ptr() as *mut libc::c_char,
7878
::std::mem::size_of::<[libc::c_char; 32]>() as usize,
7979
(c"%.2f".as_ptr().cast_mut()).cast_const() as *const libc::c_char,
80-
(3.14159E+0),
80+
(3.1415899999999999E+0),
8181
)
8282
}) == (4)) as i32)
8383
!= 0)
@@ -226,7 +226,7 @@ unsafe fn main_0() -> i32 {
226226
buf.as_mut_ptr() as *mut libc::c_char,
227227
::std::mem::size_of::<[libc::c_char; 32]>() as usize,
228228
(fmt.as_mut_ptr()).cast_const() as *const libc::c_char,
229-
(3.26E+0),
229+
(3.2599999999999998E+0),
230230
)
231231
}) == (5)) as i32)
232232
!= 0)

0 commit comments

Comments
 (0)