@@ -128,7 +128,7 @@ TEST_CASE( "attribute_dtype_test", "[core]" )
128
128
TEST_CASE ( " output_default_test" , " [core]" )
129
129
{
130
130
using IE = IterationEncoding;
131
- Series o = Series (" ./new_openpmd_output_%T" , AccessType::CREATE);
131
+ Series o = Series (" ./new_openpmd_output_%T.json " , AccessType::CREATE);
132
132
133
133
REQUIRE (o.openPMD () == " 1.1.0" );
134
134
REQUIRE (o.openPMDextension () == static_cast <uint32_t >(0 ));
@@ -145,7 +145,7 @@ TEST_CASE( "output_default_test", "[core]" )
145
145
TEST_CASE ( " output_constructor_test" , " [core]" )
146
146
{
147
147
using IE = IterationEncoding;
148
- Series o = Series (" ./MyCustomOutput" , AccessType::CREATE);
148
+ Series o = Series (" ./MyCustomOutput.json " , AccessType::CREATE);
149
149
150
150
o.setMeshesPath (" customMeshesPath" ).setParticlesPath (" customParticlesPath" );
151
151
@@ -169,7 +169,7 @@ TEST_CASE( "output_constructor_test", "[core]" )
169
169
170
170
TEST_CASE ( " output_modification_test" , " [core]" )
171
171
{
172
- Series o = Series (" ./MyOutput_%T" , AccessType::CREATE);
172
+ Series o = Series (" ./MyOutput_%T.json " , AccessType::CREATE);
173
173
174
174
o.setOpenPMD (" 1.0.0" );
175
175
REQUIRE (o.openPMD () == " 1.0.0" );
@@ -194,7 +194,7 @@ TEST_CASE( "output_modification_test", "[core]" )
194
194
195
195
TEST_CASE ( " iteration_default_test" , " [core]" )
196
196
{
197
- Series o = Series (" ./MyOutput_%T" , AccessType::CREATE);
197
+ Series o = Series (" ./MyOutput_%T.json " , AccessType::CREATE);
198
198
199
199
Iteration& i = o.iterations [42 ];
200
200
@@ -208,7 +208,7 @@ TEST_CASE( "iteration_default_test", "[core]" )
208
208
209
209
TEST_CASE ( " iteration_modification_test" , " [core]" )
210
210
{
211
- Series o = Series (" ./MyOutput_%T" , AccessType::CREATE);
211
+ Series o = Series (" ./MyOutput_%T.json " , AccessType::CREATE);
212
212
213
213
Iteration& i = o.iterations [42 ];
214
214
@@ -226,7 +226,7 @@ TEST_CASE( "iteration_modification_test", "[core]" )
226
226
227
227
TEST_CASE ( " particleSpecies_modification_test" , " [core]" )
228
228
{
229
- Series o = Series (" ./MyOutput_%T" , AccessType::CREATE);
229
+ Series o = Series (" ./MyOutput_%T.json " , AccessType::CREATE);
230
230
231
231
auto & particles = o.iterations [42 ].particles ;
232
232
REQUIRE (0 == particles.numAttributes ());
@@ -255,7 +255,7 @@ TEST_CASE( "particleSpecies_modification_test", "[core]" )
255
255
256
256
TEST_CASE ( " record_constructor_test" , " [core]" )
257
257
{
258
- Series o = Series (" ./MyOutput_%T" , AccessType::CREATE);
258
+ Series o = Series (" ./MyOutput_%T.json " , AccessType::CREATE);
259
259
260
260
ParticleSpecies ps = o.iterations [42 ].particles [" species" ];
261
261
Record& r = ps[" record" ];
@@ -277,7 +277,7 @@ TEST_CASE( "record_constructor_test", "[core]" )
277
277
278
278
TEST_CASE ( " record_modification_test" , " [core]" )
279
279
{
280
- Series o = Series (" ./MyOutput_%T" , AccessType::CREATE);
280
+ Series o = Series (" ./MyOutput_%T.json " , AccessType::CREATE);
281
281
282
282
auto species = o.iterations [42 ].particles [" species" ];
283
283
Record& r = species[" position" ];
@@ -305,7 +305,7 @@ TEST_CASE( "record_modification_test", "[core]" )
305
305
306
306
TEST_CASE ( " recordComponent_modification_test" , " [core]" )
307
307
{
308
- Series o = Series (" ./MyOutput_%T" , AccessType::CREATE);
308
+ Series o = Series (" ./MyOutput_%T.json " , AccessType::CREATE);
309
309
310
310
ParticleSpecies ps = o.iterations [42 ].particles [" species" ];
311
311
Record& r = ps[" record" ];
@@ -327,7 +327,7 @@ TEST_CASE( "recordComponent_modification_test", "[core]" )
327
327
328
328
TEST_CASE ( " mesh_constructor_test" , " [core]" )
329
329
{
330
- Series o = Series (" ./MyOutput_%T" , AccessType::CREATE);
330
+ Series o = Series (" ./MyOutput_%T.json " , AccessType::CREATE);
331
331
332
332
Mesh &m = o.iterations [42 ].meshes [" E" ];
333
333
@@ -355,7 +355,7 @@ TEST_CASE( "mesh_constructor_test", "[core]" )
355
355
356
356
TEST_CASE ( " mesh_modification_test" , " [core]" )
357
357
{
358
- Series o = Series (" ./MyOutput_%T" , AccessType::CREATE);
358
+ Series o = Series (" ./MyOutput_%T.json " , AccessType::CREATE);
359
359
360
360
Mesh &m = o.iterations [42 ].meshes [" E" ];
361
361
m[" x" ];
@@ -395,7 +395,7 @@ TEST_CASE( "mesh_modification_test", "[core]" )
395
395
TEST_CASE ( " structure_test" , " [core]" )
396
396
{
397
397
#if openPMD_USE_INVASIVE_TESTS
398
- Series o = Series (" ./new_openpmd_output_%T" , AccessType::CREATE);
398
+ Series o = Series (" ./new_openpmd_output_%T.json " , AccessType::CREATE);
399
399
400
400
REQUIRE (o.IOHandler );
401
401
REQUIRE (o.iterations .IOHandler );
@@ -520,7 +520,7 @@ TEST_CASE( "structure_test", "[core]" )
520
520
521
521
TEST_CASE ( " wrapper_test" , " [core]" )
522
522
{
523
- Series o = Series (" ./new_openpmd_output" , AccessType::CREATE);
523
+ Series o = Series (" ./new_openpmd_output.json " , AccessType::CREATE);
524
524
525
525
o.setOpenPMDextension (42 );
526
526
o.setIterationEncoding (IterationEncoding::fileBased);
@@ -569,8 +569,11 @@ TEST_CASE( "wrapper_test", "[core]" )
569
569
mrc2.loadChunk (shareRaw (&loadData), {0 }, {1 });
570
570
o.flush ();
571
571
REQUIRE (loadData == value);
572
- value = 43 .;
573
- mrc2.makeConstant (value);
572
+ // TODO: do we want to be able to make data constant after already writing it once?
573
+ // value = 43.;
574
+ // mrc2.makeConstant(value);
575
+ REQUIRE_THROWS_WITH (mrc2.makeConstant (value),
576
+ Catch::Equals (" A recordComponent can not (yet) be made constant after it has been written." ));
574
577
std::array< double , 1 > moreData = {{ 112233 . }};
575
578
o.iterations [4 ].meshes [" E" ][" y" ].loadChunk (shareRaw (moreData), {0 }, {1 });
576
579
o.flush ();
@@ -639,7 +642,7 @@ TEST_CASE( "wrapper_test", "[core]" )
639
642
640
643
TEST_CASE ( " use_count_test" , " [core]" )
641
644
{
642
- Series o = Series (" ./new_openpmd_output" , AccessType::CREATE);
645
+ Series o = Series (" ./new_openpmd_output.json " , AccessType::CREATE);
643
646
644
647
MeshRecordComponent mrc = o.iterations [1 ].meshes [" E" ][" x" ];
645
648
mrc.resetDataset (Dataset (determineDatatype<uint16_t >(), {42 }));
@@ -663,7 +666,7 @@ TEST_CASE( "use_count_test", "[core]" )
663
666
664
667
TEST_CASE ( " empty_record_test" , " [core]" )
665
668
{
666
- Series o = Series (" ./new_openpmd_output" , AccessType::CREATE);
669
+ Series o = Series (" ./new_openpmd_output.json " , AccessType::CREATE);
667
670
668
671
o.iterations [1 ].meshes [" E" ].setComment (" No assumption about contained RecordComponents will be made" );
669
672
REQUIRE_THROWS_WITH (o.flush (),
@@ -674,7 +677,7 @@ TEST_CASE( "empty_record_test", "[core]" )
674
677
675
678
TEST_CASE ( " zero_extent_component" , " [core]" )
676
679
{
677
- Series o = Series (" ./new_openpmd_output" , AccessType::CREATE);
680
+ Series o = Series (" ./new_openpmd_output.json " , AccessType::CREATE);
678
681
679
682
auto E_x = o.iterations [1 ].meshes [" E" ][" x" ];
680
683
E_x.setComment (" Datasets must contain dimensions." );
@@ -683,4 +686,14 @@ TEST_CASE( "zero_extent_component", "[core]" )
683
686
REQUIRE_THROWS_WITH (E_x.makeEmpty <int >(0 ),
684
687
Catch::Equals (" Dataset extent must be at least 1D." ));
685
688
E_x.resetDataset (Dataset (Datatype::DOUBLE, {1 }));
686
- }
689
+ }
690
+
691
+ TEST_CASE ( " no_file_ending" , " [core]" )
692
+ {
693
+ REQUIRE_THROWS_WITH (Series (" ./new_openpmd_output" , AccessType::CREATE),
694
+ Catch::Equals (" Unknown file format! Did you specify a file ending?" ));
695
+ REQUIRE_THROWS_WITH (Series (" ./new_openpmd_output_%T" , AccessType::CREATE),
696
+ Catch::Equals (" Unknown file format! Did you specify a file ending?" ));
697
+ REQUIRE_THROWS_WITH (Series (" ./new_openpmd_output_%05T" , AccessType::CREATE),
698
+ Catch::Equals (" Unknown file format! Did you specify a file ending?" ));
699
+ }
0 commit comments