opendp 0.14.2-dev.20260401.2

A library of differential privacy algorithms for the statistical analysis of sensitive private data.
1
2
3
4
5
6
7
8
9
10
11
12
use super::*;

#[test]
fn test_make_sized_bounded_int_checked_sum() -> Fallible<()> {
    let trans = make_sized_bounded_int_checked_sum(4, (1, 10))?;
    let sum = trans.invoke(&vec![1, 2, 3, 4])?;
    assert_eq!(sum, 10);

    // should error under these conditions
    assert!(make_sized_bounded_int_checked_sum::<u8>(2, (0, 255)).is_err());
    Ok(())
}