mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-03 08:44:12 +02:00
Add test to validate pulse_id ranges and steps
This commit is contained in:
@@ -135,4 +135,23 @@ TEST(JFH5Writer, test_step_pulse_id)
|
||||
TEST(JFH5Writer, test_writing_with_step)
|
||||
{
|
||||
// TODO: Implement this test.
|
||||
}
|
||||
|
||||
TEST(JFH5Writer, test_exceptions)
|
||||
{
|
||||
// Should be ok.
|
||||
ASSERT_NO_THROW(JFH5Writer("ignore.h5", 1, 1234, 1234, 1));
|
||||
// Should be ok.
|
||||
ASSERT_NO_THROW(JFH5Writer("ignore.h5", 1, 1234, 4567, 1));
|
||||
// Should be ok.
|
||||
ASSERT_NO_THROW(JFH5Writer("ignore.h5", 1, 4, 4, 4));
|
||||
|
||||
// stop smaller than start.
|
||||
ASSERT_THROW(JFH5Writer("ignore.h5", 1, 1234, 1233, 1), runtime_error);
|
||||
// step is not valid for 100Hz.
|
||||
ASSERT_THROW(JFH5Writer("ignore.h5", 1, 1234, 1234, 3), runtime_error);
|
||||
// start not divisible by step.
|
||||
ASSERT_THROW(JFH5Writer("ignore.h5", 1, 10, 10, 4), runtime_error);
|
||||
// stop not divisible by step
|
||||
ASSERT_THROW(JFH5Writer("ignore.h5", 1, 8, 10, 4), runtime_error);
|
||||
}
|
||||
Reference in New Issue
Block a user