From e4e00b3ae9442938beeccb9ddc602ab2af332662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Thu, 31 Mar 2022 15:19:14 +0200 Subject: [PATCH] Test all backends --- test/SerialIOTest.cpp | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/test/SerialIOTest.cpp b/test/SerialIOTest.cpp index d04ff2e83a..aa4041b55e 100644 --- a/test/SerialIOTest.cpp +++ b/test/SerialIOTest.cpp @@ -5506,6 +5506,7 @@ TEST_CASE("no_explicit_flush", "[serial]") void unfinished_iteration_test( std::string const &ext, bool filebased, std::string const &config = "{}") { + std::cout << "\n\nTESTING " << ext << "\n\n" << std::endl; std::string file = std::string("../samples/unfinished_iteration") + (filebased ? "_%T." : ".") + ext; { @@ -5525,15 +5526,27 @@ void unfinished_iteration_test( it10.particles["e"]["mass"][RecordComponent::SCALAR]; } { - Series read(file, Access::READ_ONLY); + Series read(file, Access::READ_ONLY, config); + std::vector iterations; std::cout << "Going to list iterations in " << file << ":" << std::endl; - for (auto const &iteration : read.readIterations()) + for (auto iteration : read.readIterations()) { - // @todo ensure that only the correct iterations are seen. std::cout << "Seeing iteration " << iteration.iterationIndex << std::endl; iterations.push_back(iteration.iterationIndex); + + Parameter readAttribute; + readAttribute.name = "this_does_definitely_not_exist"; + read.IOHandler()->enqueue(IOTask(&iteration, readAttribute)); + // enqueue a second time to check that the queue is cleared upon + // exception + read.IOHandler()->enqueue(IOTask(&iteration, readAttribute)); + + REQUIRE_THROWS_AS( + read.IOHandler()->flush({FlushLevel::InternalFlush}), + error::ReadError); + REQUIRE(read.IOHandler()->m_work.empty()); } REQUIRE( (iterations == @@ -5544,18 +5557,26 @@ void unfinished_iteration_test( TEST_CASE("unfinished_iteration_test", "[serial]") { #if openPMD_HAVE_ADIOS2 - unfinished_iteration_test("bp", false); + unfinished_iteration_test("bp", false, "backend = \"adios2\""); unfinished_iteration_test( "bp", false, R"( +backend = "adios2" iteration_encoding = "variable_based" adios2.schema = 20210209)"); - unfinished_iteration_test("bp", true); + unfinished_iteration_test("bp", true, "backend = \"adios2\""); #endif -#if 1 +#if openPMD_HAVE_ADIOS2 + unfinished_iteration_test("adios1.bp", false, "backend = \"adios1\""); + unfinished_iteration_test("adios1.bp", true, "backend = \"adios1\""); +#endif +#if openPMD_HAVE_HDF5 unfinished_iteration_test("h5", false); + unfinished_iteration_test("h5", true); #endif + unfinished_iteration_test("json", false); + unfinished_iteration_test("json", true); } #endif