2525
2626using namespace openPMD ;
2727
28- Dataset globalDataset (Datatype::CHAR, {1 });
29-
3028TEST_CASE (" versions_test" , " [core]" )
3129{
3230 auto const apiVersion = getVersion ();
@@ -441,11 +439,11 @@ TEST_CASE("record_constructor_test", "[core]")
441439 ps[" position" ][RecordComponent::SCALAR].resetDataset (dset);
442440 ps[" positionOffset" ][RecordComponent::SCALAR].resetDataset (dset);
443441
444- REQUIRE (r[" x" ].resetDataset (dset). unitSI () == 1 );
442+ REQUIRE (r[" x" ].unitSI () == 1 );
445443 REQUIRE (r[" x" ].numAttributes () == 1 ); /* unitSI */
446- REQUIRE (r[" y" ].resetDataset (dset). unitSI () == 1 );
444+ REQUIRE (r[" y" ].unitSI () == 1 );
447445 REQUIRE (r[" y" ].numAttributes () == 1 ); /* unitSI */
448- REQUIRE (r[" z" ].resetDataset (dset). unitSI () == 1 );
446+ REQUIRE (r[" z" ].unitSI () == 1 );
449447 REQUIRE (r[" z" ].numAttributes () == 1 ); /* unitSI */
450448 std::array<double , 7 > zeros{{0 ., 0 ., 0 ., 0 ., 0 ., 0 ., 0 .}};
451449 REQUIRE (r.unitDimension () == zeros);
@@ -490,15 +488,13 @@ TEST_CASE("recordComponent_modification_test", "[core]")
490488
491489 r[" x" ].setUnitSI (2.55999e-7 );
492490 r[" y" ].setUnitSI (4.42999e-8 );
493- REQUIRE (
494- r[" x" ].resetDataset (dset).unitSI () == static_cast <double >(2.55999e-7 ));
491+ REQUIRE (r[" x" ].unitSI () == static_cast <double >(2.55999e-7 ));
495492 REQUIRE (r[" x" ].numAttributes () == 1 ); /* unitSI */
496- REQUIRE (
497- r[" y" ].resetDataset (dset).unitSI () == static_cast <double >(4.42999e-8 ));
493+ REQUIRE (r[" y" ].unitSI () == static_cast <double >(4.42999e-8 ));
498494 REQUIRE (r[" y" ].numAttributes () == 1 ); /* unitSI */
499495
500496 r[" z" ].setUnitSI (1 );
501- REQUIRE (r[" z" ].resetDataset (dset). unitSI () == static_cast <double >(1 ));
497+ REQUIRE (r[" z" ].unitSI () == static_cast <double >(1 ));
502498 REQUIRE (r[" z" ].numAttributes () == 1 ); /* unitSI */
503499}
504500
@@ -509,13 +505,13 @@ TEST_CASE("mesh_constructor_test", "[core]")
509505 Mesh &m = o.iterations [42 ].meshes [" E" ];
510506
511507 std::vector<double > pos{0 };
512- REQUIRE (m[" x" ].resetDataset (globalDataset). unitSI () == 1 );
508+ REQUIRE (m[" x" ].unitSI () == 1 );
513509 REQUIRE (m[" x" ].numAttributes () == 2 ); /* unitSI, position */
514510 REQUIRE (m[" x" ].position <double >() == pos);
515- REQUIRE (m[" y" ].resetDataset (globalDataset). unitSI () == 1 );
511+ REQUIRE (m[" y" ].unitSI () == 1 );
516512 REQUIRE (m[" y" ].numAttributes () == 2 ); /* unitSI, position */
517513 REQUIRE (m[" y" ].position <double >() == pos);
518- REQUIRE (m[" z" ].resetDataset (globalDataset). unitSI () == 1 );
514+ REQUIRE (m[" z" ].unitSI () == 1 );
519515 REQUIRE (m[" z" ].numAttributes () == 2 ); /* unitSI, position */
520516 REQUIRE (m[" z" ].position <double >() == pos);
521517 REQUIRE (m.geometry () == Mesh::Geometry::cartesian);
@@ -538,9 +534,9 @@ TEST_CASE("mesh_modification_test", "[core]")
538534 Series o = Series (" ./MyOutput_%T.json" , Access::CREATE);
539535
540536 Mesh &m = o.iterations [42 ].meshes [" E" ];
541- m[" x" ]. resetDataset (globalDataset) ;
542- m[" y" ]. resetDataset (globalDataset) ;
543- m[" z" ]. resetDataset (globalDataset) ;
537+ m[" x" ];
538+ m[" y" ];
539+ m[" z" ];
544540
545541 m.setGeometry (Mesh::Geometry::spherical);
546542 REQUIRE (m.geometry () == Mesh::Geometry::spherical);
0 commit comments