Skip to content

Commit

Permalink
Combined test: append mode and weird iteration order
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Feb 21, 2022
1 parent 1c50e00 commit f82e21c
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions test/SerialIOTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5625,7 +5625,25 @@ void append_mode(
}

writeSomeIterations(
write.writeIterations(), std::vector<uint64_t>{4, 3});
write.writeIterations(), std::vector<uint64_t>{4, 3, 10});
write.flush();
}
{
Series write(filename, Access::APPEND, jsonConfig);
if (variableBased)
{
write.setIterationEncoding(IterationEncoding::variableBased);
}
if (write.backend() == "ADIOS1")
{
REQUIRE_THROWS_AS(
write.flush(), error::OperationUnsupportedInBackend);
// destructor will be noisy now
return;
}

writeSomeIterations(
write.writeIterations(), std::vector<uint64_t>{7, 1, 11});
write.flush();
}
{
Expand All @@ -5635,18 +5653,19 @@ void append_mode(
// in variable-based encodings, iterations are not parsed ahead of
// time but as they go
unsigned counter = 0;
uint64_t iterationOrder[] = {0, 1, 2, 3, 4, 10, 7, 11};
for (auto iteration : read.readIterations())
{
REQUIRE(iteration.iterationIndex == counter);
REQUIRE(iteration.iterationIndex == iterationOrder[counter]);
++counter;
}
REQUIRE(counter == 5);
REQUIRE(counter == 8);
// Cannot do listSeries here because the Series is already drained
REQUIRE_THROWS_AS(helper::listSeries(read), error::WrongAPIUsage);
}
else
{
REQUIRE(read.iterations.size() == 5);
REQUIRE(read.iterations.size() == 8);
/*
* Roadmap: for now, reading this should work by ignoring the last
* duplicate iteration.
Expand Down

0 comments on commit f82e21c

Please sign in to comment.