From ebc02cc303df2247172a4fcaef5b36f1424f496a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Tue, 29 Oct 2024 11:22:03 +0100 Subject: [PATCH] Update close_iteration_test --- test/Files_SerialIO/close_iteration_test.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/test/Files_SerialIO/close_iteration_test.cpp b/test/Files_SerialIO/close_iteration_test.cpp index f4ab333636..dcc1969ded 100644 --- a/test/Files_SerialIO/close_iteration_test.cpp +++ b/test/Files_SerialIO/close_iteration_test.cpp @@ -1,6 +1,7 @@ #include "SerialIOTests.hpp" #include "openPMD/IO/ADIOS/macros.hpp" #include "openPMD/IO/Access.hpp" +#include "openPMD/Series.hpp" #include "openPMD/auxiliary/Filesystem.hpp" #include @@ -80,15 +81,14 @@ auto run_test_filebased( series = Series(filename, Access::READ_WRITE, write_cfg); { - // @todo proper support for READ_WRITE in snapshots() - auto it = series.iterations[0].open(); + auto it = series.snapshots()[0].open(); std::vector data(5); it.meshes["E"]["x"].loadChunkRaw(data.data(), {0}, {5}); it.close(); REQUIRE((data == std::vector{0, 1, 2, 3, 4})); } { - auto it = series.iterations[2].open(); + auto it = series.snapshots()[2].open(); std::vector data(5); it.meshes["E"]["x"].loadChunkRaw(data.data(), {0}, {5}); it.close(); @@ -98,7 +98,7 @@ auto run_test_filebased( } { - auto it = series.iterations[3].open(); + auto it = series.snapshots()[3].open(); auto E_x = it.meshes["E"]["x"]; E_x.resetDataset({Datatype::INT, {5}}); std::vector data{0, 1, 2, 3, 4}; @@ -274,6 +274,12 @@ auto close_and_reopen_test() -> void run_test_filebased([](Series &s) { return s.iterations; }, "bp"); run_test_filebased([](Series &s) { return s.writeIterations(); }, "bp"); run_test_filebased([](Series &s) { return s.snapshots(); }, "bp"); + run_test_filebased( + [](Series &s) { return s.snapshots(SnapshotWorkflow::Synchronous); }, + "bp"); + run_test_filebased( + [](Series &s) { return s.snapshots(SnapshotWorkflow::RandomAccess); }, + "bp"); run_test_filebased([](Series &s) { return s.snapshots(); }, "json"); #if openPMD_HAVE_HDF5 run_test_filebased([](Series &s) { return s.snapshots(); }, "h5");