Skip to content

Commit b75cc37

Browse files
committed
Assert a panic when startRendering is called multiple times
1 parent c98e15f commit b75cc37

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/context/offline.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,12 @@ mod tests {
120120
assert_float_eq!(buffer.get_channel_data(0), &[0.; 555][..], abs_all <= 0.);
121121
assert_float_eq!(buffer.get_channel_data(1), &[0.; 555][..], abs_all <= 0.);
122122
}
123+
124+
#[test]
125+
#[should_panic]
126+
fn render_twice_panics() {
127+
let mut context = OfflineAudioContext::new(2, 555, 44_100.);
128+
let _ = context.start_rendering_sync();
129+
let _ = context.start_rendering_sync();
130+
}
123131
}

0 commit comments

Comments
 (0)