Skip to content

Commit

Permalink
wip: chase windows failure
Browse files Browse the repository at this point in the history
  • Loading branch information
vasild committed May 13, 2024
1 parent 9501fcb commit 62a02ed
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/test/flatfile_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,28 @@ BOOST_AUTO_TEST_CASE(flatfile_open)
size_t pos1 = 0;
size_t pos2 = pos1 + GetSerializeSize(line1);

fprintf(stderr, "AAAAA flatfile_open(): 01\n");
// Write first line to file.
{
AutoFile file{seq.Open(FlatFilePos(0, pos1))};
file << LIMITED_STRING(line1, 256);
}

fprintf(stderr, "AAAAA flatfile_open(): 02\n");
// Attempt to append to file opened in read-only mode.
{
AutoFile file{seq.Open(FlatFilePos(0, pos2), true)};
BOOST_CHECK_THROW(file << LIMITED_STRING(line2, 256), std::ios_base::failure);
}

fprintf(stderr, "AAAAA flatfile_open(): 03\n");
// Append second line to file.
{
AutoFile file{seq.Open(FlatFilePos(0, pos2))};
file << LIMITED_STRING(line2, 256);
}

fprintf(stderr, "AAAAA flatfile_open(): 04\n");
// Read text from file in read-only mode.
{
std::string text;
Expand All @@ -72,6 +76,7 @@ BOOST_AUTO_TEST_CASE(flatfile_open)
BOOST_CHECK_EQUAL(text, line2);
}

fprintf(stderr, "AAAAA flatfile_open(): 05\n");
// Read text from file with position offset.
{
std::string text;
Expand All @@ -81,6 +86,7 @@ BOOST_AUTO_TEST_CASE(flatfile_open)
BOOST_CHECK_EQUAL(text, line2);
}

fprintf(stderr, "AAAAA flatfile_open(): 06\n");
// Ensure another file in the sequence has no data.
{
std::string text;
Expand Down

0 comments on commit 62a02ed

Please sign in to comment.