Add test for buffer utils

This commit is contained in:
2020-04-21 20:19:13 +02:00
parent 8be4c4db3f
commit 5294015206
3 changed files with 20 additions and 2 deletions
+16
View File
@@ -45,4 +45,20 @@ TEST(BufferUtils, get_file_frame_index)
ASSERT_EQ(BufferUtils::get_file_frame_index(12345000), 0);
ASSERT_EQ(BufferUtils::get_file_frame_index(12345543), 543);
ASSERT_EQ(BufferUtils::get_file_frame_index(12345999), 999);
}
TEST(BufferUtils, get_path_suffixes)
{
auto suffixes = BufferUtils::get_path_suffixes(15100, 17500);
ASSERT_EQ(suffixes[0].start_pulse_id, 15000);
ASSERT_EQ(suffixes[0].stop_pulse_id, 15999);
ASSERT_EQ(suffixes[0].path, "0/15000.h5");
ASSERT_EQ(suffixes[1].start_pulse_id, 16000);
ASSERT_EQ(suffixes[1].stop_pulse_id, 16999);
ASSERT_EQ(suffixes[1].path, "0/16000.h5");
ASSERT_EQ(suffixes[2].start_pulse_id, 17000);
ASSERT_EQ(suffixes[2].stop_pulse_id, 17999);
ASSERT_EQ(suffixes[2].path, "0/17000.h5");
}