()
| 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() { |