MCPcopy Create free account
hub / github.com/SoftbearStudios/bitcode / test_isize_too_big

Function test_isize_too_big

src/pack_ints.rs:523–535  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

521
522 #[test]
523 fn test_isize_too_big() {
524 for scale in [1, 1 << 8, 1 << 16, 1 << 32] {
525 let a = COUNTING.map(|v| v as i64 * scale + i32::MAX as i64);
526 let packed = pack_ints(&a);
527 let b = unpack_ints::<isize>(&packed, a.len());
528 if cfg!(target_pointer_width = "64") {
529 let b = b.unwrap();
530 assert_eq!(a, std::array::from_fn(|i| b[i] as i64));
531 } else {
532 assert_eq!(b.unwrap_err(), usize_too_big());
533 }
534 }
535 }
536
537 #[test]
538 fn test_i8_special_case() {

Callers

nothing calls this directly

Calls 2

pack_intsFunction · 0.85
lenMethod · 0.45

Tested by

no test coverage detected