Skip to content

Commit

Permalink
WIP: Change datatype in test
Browse files Browse the repository at this point in the history
Somehow truncation test is broken by this
  • Loading branch information
franzpoeschel committed Nov 26, 2024
1 parent f33f078 commit 69db49d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/SerialIOTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7522,6 +7522,8 @@ void groupbased_read_write(std::string const &ext)

E_x.setAttribute("updated_in_run", 0);
E_y.setAttribute("updated_in_run", 0);
E_y.setAttribute("changed_datatype_in_run", 0);
write.close();
}

{
Expand All @@ -7540,6 +7542,8 @@ void groupbased_read_write(std::string const &ext)

E_x.setAttribute("updated_in_run", 1);
E_y.setAttribute("updated_in_run", 1);
E_y.setAttribute("changed_datatype_in_run", "one");
write.close();
}

{
Expand All @@ -7551,6 +7555,9 @@ void groupbased_read_write(std::string const &ext)
REQUIRE(E_x_0_fromRun0.getAttribute("updated_in_run").get<int>() == 0);
REQUIRE(E_x_1_fromRun1.getAttribute("updated_in_run").get<int>() == 1);
REQUIRE(E_y_0_fromRun1.getAttribute("updated_in_run").get<int>() == 1);
REQUIRE(
E_y_0_fromRun1.getAttribute("changed_datatype_in_run")
.get<std::string>() == "one");

auto chunk_E_x_0_fromRun0 = E_x_0_fromRun0.loadChunk<int>({0}, {1});
auto chunk_E_x_1_fromRun1 = E_x_1_fromRun1.loadChunk<int>({0}, {1});
Expand All @@ -7561,8 +7568,12 @@ void groupbased_read_write(std::string const &ext)
REQUIRE(*chunk_E_x_0_fromRun0 == 0);
REQUIRE(*chunk_E_x_1_fromRun1 == 1);
REQUIRE(*chunk_E_y_0_fromRun1 == 1);
read.close();
}

return;
std::cout << "Now truncate " << filename << std::endl;

// check that truncation works correctly
{
Series write(filename, Access::CREATE);
Expand All @@ -7574,12 +7585,14 @@ void groupbased_read_write(std::string const &ext)

E_x.storeChunkRaw(&data, {0}, {1});
E_x.setAttribute("updated_in_run", 2);
write.close();
}

{
Series read(filename, Access::READ_ONLY);
REQUIRE(read.iterations.size() == 1);
REQUIRE(read.iterations.count(2) == 1);
read.close();
}
}

Expand Down

0 comments on commit 69db49d

Please sign in to comment.