Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Dec 20, 2024
1 parent 3b494e8 commit 4ad0aea
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/all/component_model/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,26 +503,26 @@ fn floats() -> Result<()> {
.call(&mut store, (CANON_32BIT_NAN | 1,))?
.0
.to_bits(),
CANON_32BIT_NAN
CANON_32BIT_NAN | 1
);
u32_to_f32.post_return(&mut store)?;
assert_eq!(
u64_to_f64
.call(&mut store, (CANON_64BIT_NAN | 1,))?
.0
.to_bits(),
CANON_64BIT_NAN,
CANON_64BIT_NAN | 1,
);
u64_to_f64.post_return(&mut store)?;

assert_eq!(
f32_to_u32.call(&mut store, (f32::from_bits(CANON_32BIT_NAN | 1),))?,
(CANON_32BIT_NAN,)
(CANON_32BIT_NAN | 1,)
);
f32_to_u32.post_return(&mut store)?;
assert_eq!(
f64_to_u64.call(&mut store, (f64::from_bits(CANON_64BIT_NAN | 1),))?,
(CANON_64BIT_NAN,)
(CANON_64BIT_NAN | 1,)
);
f64_to_u64.post_return(&mut store)?;

Expand Down Expand Up @@ -937,7 +937,10 @@ fn many_parameters() -> Result<()> {
assert_eq!(i8::from_le_bytes(*actual.take_n::<1>()), input.0);
actual.skip::<7>();
assert_eq!(u64::from_le_bytes(*actual.take_n::<8>()), input.1);
assert_eq!(u32::from_le_bytes(*actual.take_n::<4>()), CANON_32BIT_NAN);
assert_eq!(
u32::from_le_bytes(*actual.take_n::<4>()),
CANON_32BIT_NAN | 1
);
assert_eq!(u8::from_le_bytes(*actual.take_n::<1>()), input.3);
actual.skip::<1>();
assert_eq!(i16::from_le_bytes(*actual.take_n::<2>()), input.4);
Expand Down Expand Up @@ -1703,7 +1706,7 @@ fn expected() -> Result<()> {
let ret = to_expected_s16_f32
.call(&mut store, (1, CANON_32BIT_NAN | 1))?
.0;
assert_eq!(ret.unwrap_err().to_bits(), CANON_32BIT_NAN);
assert_eq!(ret.unwrap_err().to_bits(), CANON_32BIT_NAN | 1);
to_expected_s16_f32.post_return(&mut store)?;
assert!(to_expected_s16_f32.call(&mut store, (2, 0)).is_err());

Expand Down

0 comments on commit 4ad0aea

Please sign in to comment.