@@ -1666,7 +1666,13 @@ void fileBased_write_test(const std::string & backend)
16661666 {
16671667 Series o = Series (" ../samples/subdir/serial_fileBased_write%01T." + backend, Access::READ_WRITE);
16681668
1669- REQUIRE (o.iterations .empty ());
1669+ REQUIRE (o.iterations .size () == 1 );
1670+ /*
1671+ * 123456 has no padding, it's just a very long number.
1672+ * So even when opening the series with a padding of 1,
1673+ * that iteration will be opened.
1674+ */
1675+ REQUIRE (o.iterations .count (123456 ) == 1 );
16701676
16711677 auto & it = o.iterations [10 ];
16721678 ParticleSpecies& e = it.particles [" e" ];
@@ -1678,7 +1684,7 @@ void fileBased_write_test(const std::string & backend)
16781684 fileBased_add_EDpic (e, 42 );
16791685 it.setTime (static_cast < double >(10 ));
16801686
1681- REQUIRE (o.iterations .size () == 1 );
1687+ REQUIRE (o.iterations .size () == 2 );
16821688 }
16831689 REQUIRE ((auxiliary::file_exists (" ../samples/subdir/serial_fileBased_write10." + backend)
16841690 || auxiliary::directory_exists (" ../samples/subdir/serial_fileBased_write10." + backend)));
@@ -1707,10 +1713,10 @@ void fileBased_write_test(const std::string & backend)
17071713 // read back with fixed padding
17081714 {
17091715 Series s = Series (" ../samples/subdir/serial_fileBased_write%03T." + backend, Access::READ_ONLY);
1710- REQUIRE (s.iterations .size () == 6 );
1716+ REQUIRE (s.iterations .size () == 7 );
17111717 REQUIRE (s.iterations .contains (4 ));
17121718 REQUIRE (!s.iterations .contains (10 ));
1713- REQUIRE (! s.iterations .contains (123456 ));
1719+ REQUIRE (s.iterations .contains (123456 ));
17141720
17151721 REQUIRE (s.iterations [3 ].time < double >() == 3.0 );
17161722 REQUIRE (s.iterations [4 ].time < double >() == 4.0 );
@@ -1729,7 +1735,8 @@ void fileBased_write_test(const std::string & backend)
17291735 REQUIRE (s.iterations [4 ].time < double >() == 4.0 );
17301736 REQUIRE (s.iterations [5 ].time < double >() == 5.0 );
17311737 REQUIRE (s.iterations [10 ].time < double >() == 10.0 );
1732- REQUIRE (s.iterations [123456 ].time < double >() == 0.0 );
1738+ REQUIRE (s.iterations [123456 ].time < double >() ==
1739+ static_cast <double >(123456 ));
17331740 }
17341741
17351742 {
0 commit comments