()
| 506 | |
| 507 | #[test] |
| 508 | fn test_usize_too_big() { |
| 509 | for scale in [1, 1 << 8, 1 << 16, 1 << 32] { |
| 510 | let a = COUNTING.map(|v| v as u64 * scale + u32::MAX as u64); |
| 511 | let packed = pack_ints(&a); |
| 512 | let b = unpack_ints::<usize>(&packed, a.len()); |
| 513 | if cfg!(target_pointer_width = "64") { |
| 514 | let b = b.unwrap(); |
| 515 | assert_eq!(a, std::array::from_fn(|i| b[i] as u64)); |
| 516 | } else { |
| 517 | assert_eq!(b.unwrap_err(), usize_too_big()); |
| 518 | } |
| 519 | } |
| 520 | } |
| 521 | |
| 522 | #[test] |
| 523 | fn test_isize_too_big() { |