Skip to content

Commit

Permalink
[Tests/unit/core] : Explicitly save the content of the writer before …
Browse files Browse the repository at this point in the history
…employing the reader
  • Loading branch information
msieben committed Aug 13, 2024
1 parent 00762c9 commit 1195776
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Tests/unit/core/test_valuerecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ namespace Core {
EXPECT_EQ(_writer->Value(), value);
}

void Save()
{
_writer->Save();
}

private:
const string _file;
::Thunder::Core::ProxyType<::Thunder::Core::RecorderType<uint32_t, BLOCKSIZE>::Writer> _writer;
Expand Down Expand Up @@ -85,19 +90,21 @@ namespace Core {

// Get a valid position
Reset(StartId());

ASSERT_TRUE(IsValid());

EXPECT_EQ(Id(), StartId());

EXPECT_STREQ(Source().c_str(), _file.c_str());
EXPECT_EQ(value, Value());

// Only one value recorder, some form of circular indexing
EXPECT_TRUE(Next());
EXPECT_EQ(value, Value());
ASSERT_EQ(Id(), EndId());

// Load next file if it exist
EXPECT_FALSE(Next());

// Only one value recorder, some form of circular indexing
// Load original
EXPECT_TRUE(Previous());
EXPECT_EQ(value, Value());

Expand All @@ -116,6 +123,7 @@ namespace Core {

WriterClass writer(filename);
writer.WriterJob(value);
writer.Save();

ReaderClass reader(filename);
reader.ReaderJob(value);
Expand Down

0 comments on commit 1195776

Please sign in to comment.