Commit ed53bcd
committed
tests: ov_noise_suppression: add regression test for adversarial shapes
Add a parameterized GoogleTest that loads minimal OpenVINO model XML
files describing input tensor shapes the previous commit now rejects,
and asserts that noise_suppression_load_model() either fails cleanly
or, on success, leaves nd->inp_shape entirely within the safe range
(strictly positive and below 1,000,000 per dimension).
Three shapes are exercised:
- {0x7FFFFFFFFFFFFFFF, 1024} - the integer-overflow case that
motivated the fix in the previous commit.
- {0, 0} - the zero-size-allocation case.
- {1, 480} - a representative valid shape, to make sure the guard
does not regress normal loads.
The test is self-contained: it writes the model file under /tmp keyed
on the test process pid, allocates a noise_suppression_data via
calloc(), runs the loader, and cleans up the file and structure on
exit. It exists to lock in the invariant added in
"tools: plugin: ov_noise_suppression: validate model input shape
dimensions" so future refactors do not silently drop the bound check.
Signed-off-by: OrbisAI Security <mediratta01.pally@gmail.com>1 parent e65ff91 commit ed53bcd
1 file changed
Lines changed: 62 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
0 commit comments