Skip to content

Commit 8c707c2

Browse files
committed
PR Feedback: Add OOM test for TryHashMap
1 parent 864a3dc commit 8c707c2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

mp4parse/src/fallible.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,15 @@ where
172172
}
173173
}
174174

175+
#[test]
176+
#[cfg(feature = "mp4parse_fallible")]
177+
fn tryhashmap_oom() {
178+
match TryHashMap::<char, char>::default().reserve(std::usize::MAX) {
179+
Ok(_) => panic!("it should be OOM"),
180+
_ => (),
181+
}
182+
}
183+
175184
#[derive(Default, PartialEq)]
176185
pub struct TryVec<T> {
177186
inner: std::vec::Vec<T>,

0 commit comments

Comments
 (0)