mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-04-30 21:12:24 +02:00
Test DummyWriter
This commit is contained in:
@@ -9,4 +9,20 @@ TEST(H5Writer, get_h5_writer)
|
||||
|
||||
auto real_writer = get_h5_writer("real_file.h5");
|
||||
EXPECT_FALSE(dynamic_cast<DummyH5Writer*>(real_writer.get()));
|
||||
}
|
||||
|
||||
TEST(H5Writer, DummyH5Writer)
|
||||
{
|
||||
DummyH5Writer dummy_writer;
|
||||
|
||||
EXPECT_FALSE(dummy_writer.is_file_open());
|
||||
|
||||
EXPECT_NO_THROW(dummy_writer.close_file());
|
||||
|
||||
EXPECT_THROW(dummy_writer.get_h5_file(), runtime_error);
|
||||
|
||||
unique_ptr<char> buffer(new char[1]);
|
||||
vector<size_t> shape = {1};
|
||||
|
||||
EXPECT_NO_THROW(dummy_writer.write_data("does not matter", 0, buffer.get(), shape, 0, "nop", "nop"));
|
||||
}
|
||||
Reference in New Issue
Block a user