Skip to content

Commit

Permalink
Revert the fixed tests in CoreTest
Browse files Browse the repository at this point in the history
The checks run before flushing, so it does not matter that these
components will not be flushed.
  • Loading branch information
franzpoeschel committed Apr 11, 2023
1 parent a0fbc49 commit cba1825
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions test/CoreTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

using namespace openPMD;

Dataset globalDataset(Datatype::CHAR, {1});

TEST_CASE("versions_test", "[core]")
{
auto const apiVersion = getVersion();
Expand Down Expand Up @@ -441,11 +439,11 @@ TEST_CASE("record_constructor_test", "[core]")
ps["position"][RecordComponent::SCALAR].resetDataset(dset);
ps["positionOffset"][RecordComponent::SCALAR].resetDataset(dset);

REQUIRE(r["x"].resetDataset(dset).unitSI() == 1);
REQUIRE(r["x"].unitSI() == 1);
REQUIRE(r["x"].numAttributes() == 1); /* unitSI */
REQUIRE(r["y"].resetDataset(dset).unitSI() == 1);
REQUIRE(r["y"].unitSI() == 1);
REQUIRE(r["y"].numAttributes() == 1); /* unitSI */
REQUIRE(r["z"].resetDataset(dset).unitSI() == 1);
REQUIRE(r["z"].unitSI() == 1);
REQUIRE(r["z"].numAttributes() == 1); /* unitSI */
std::array<double, 7> zeros{{0., 0., 0., 0., 0., 0., 0.}};
REQUIRE(r.unitDimension() == zeros);
Expand Down Expand Up @@ -490,15 +488,13 @@ TEST_CASE("recordComponent_modification_test", "[core]")

r["x"].setUnitSI(2.55999e-7);
r["y"].setUnitSI(4.42999e-8);
REQUIRE(
r["x"].resetDataset(dset).unitSI() == static_cast<double>(2.55999e-7));
REQUIRE(r["x"].unitSI() == static_cast<double>(2.55999e-7));
REQUIRE(r["x"].numAttributes() == 1); /* unitSI */
REQUIRE(
r["y"].resetDataset(dset).unitSI() == static_cast<double>(4.42999e-8));
REQUIRE(r["y"].unitSI() == static_cast<double>(4.42999e-8));
REQUIRE(r["y"].numAttributes() == 1); /* unitSI */

r["z"].setUnitSI(1);
REQUIRE(r["z"].resetDataset(dset).unitSI() == static_cast<double>(1));
REQUIRE(r["z"].unitSI() == static_cast<double>(1));
REQUIRE(r["z"].numAttributes() == 1); /* unitSI */
}

Expand All @@ -509,13 +505,13 @@ TEST_CASE("mesh_constructor_test", "[core]")
Mesh &m = o.iterations[42].meshes["E"];

std::vector<double> pos{0};
REQUIRE(m["x"].resetDataset(globalDataset).unitSI() == 1);
REQUIRE(m["x"].unitSI() == 1);
REQUIRE(m["x"].numAttributes() == 2); /* unitSI, position */
REQUIRE(m["x"].position<double>() == pos);
REQUIRE(m["y"].resetDataset(globalDataset).unitSI() == 1);
REQUIRE(m["y"].unitSI() == 1);
REQUIRE(m["y"].numAttributes() == 2); /* unitSI, position */
REQUIRE(m["y"].position<double>() == pos);
REQUIRE(m["z"].resetDataset(globalDataset).unitSI() == 1);
REQUIRE(m["z"].unitSI() == 1);
REQUIRE(m["z"].numAttributes() == 2); /* unitSI, position */
REQUIRE(m["z"].position<double>() == pos);
REQUIRE(m.geometry() == Mesh::Geometry::cartesian);
Expand All @@ -538,9 +534,9 @@ TEST_CASE("mesh_modification_test", "[core]")
Series o = Series("./MyOutput_%T.json", Access::CREATE);

Mesh &m = o.iterations[42].meshes["E"];
m["x"].resetDataset(globalDataset);
m["y"].resetDataset(globalDataset);
m["z"].resetDataset(globalDataset);
m["x"];
m["y"];
m["z"];

m.setGeometry(Mesh::Geometry::spherical);
REQUIRE(m.geometry() == Mesh::Geometry::spherical);
Expand Down

0 comments on commit cba1825

Please sign in to comment.