HDF5NXmx: Always use _master.h5 for consistency
This commit is contained in:
@@ -859,12 +859,12 @@ TEST_CASE("HDF5Writer_NXmxIntegrated_Basic", "[HDF5][Full]") {
|
||||
}
|
||||
|
||||
// Single integrated file, no separate master or data files
|
||||
REQUIRE(std::filesystem::exists("integrated_basic.h5"));
|
||||
REQUIRE(!std::filesystem::exists("integrated_basic_master.h5"));
|
||||
REQUIRE(!std::filesystem::exists("integrated_basic.h5"));
|
||||
REQUIRE(std::filesystem::exists("integrated_basic_master.h5"));
|
||||
REQUIRE(!std::filesystem::exists("integrated_basic_data_000001.h5"));
|
||||
|
||||
{
|
||||
HDF5ReadOnlyFile file("integrated_basic.h5");
|
||||
HDF5ReadOnlyFile file("integrated_basic_master.h5");
|
||||
|
||||
// Data should be directly in the file
|
||||
std::unique_ptr<HDF5DataSet> dataset;
|
||||
@@ -885,7 +885,7 @@ TEST_CASE("HDF5Writer_NXmxIntegrated_Basic", "[HDF5][Full]") {
|
||||
|
||||
// No leftover HDF5 objects
|
||||
REQUIRE(H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ALL) == 0);
|
||||
remove("integrated_basic.h5");
|
||||
remove("integrated_basic_master.h5");
|
||||
}
|
||||
|
||||
TEST_CASE("HDF5Writer_NXmxIntegrated_WithSpots", "[HDF5][Full]") {
|
||||
@@ -925,9 +925,9 @@ TEST_CASE("HDF5Writer_NXmxIntegrated_WithSpots", "[HDF5][Full]") {
|
||||
REQUIRE(stats.size() == 1);
|
||||
}
|
||||
|
||||
REQUIRE(std::filesystem::exists("integrated_spots.h5"));
|
||||
REQUIRE(std::filesystem::exists("integrated_spots_master.h5"));
|
||||
{
|
||||
HDF5ReadOnlyFile file("integrated_spots.h5");
|
||||
HDF5ReadOnlyFile file("integrated_spots_master.h5");
|
||||
|
||||
// Detector plugin data should exist in the same file
|
||||
REQUIRE(file.Exists("/entry/detector"));
|
||||
@@ -938,7 +938,7 @@ TEST_CASE("HDF5Writer_NXmxIntegrated_WithSpots", "[HDF5][Full]") {
|
||||
}
|
||||
|
||||
REQUIRE(H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ALL) == 0);
|
||||
remove("integrated_spots.h5");
|
||||
remove("integrated_spots_master.h5");
|
||||
}
|
||||
|
||||
TEST_CASE("HDF5Writer_NXmxIntegrated_ZeroImages", "[HDF5][Full]") {
|
||||
@@ -967,16 +967,16 @@ TEST_CASE("HDF5Writer_NXmxIntegrated_ZeroImages", "[HDF5][Full]") {
|
||||
}
|
||||
|
||||
// Master file should still exist with metadata
|
||||
REQUIRE(std::filesystem::exists("integrated_zero.h5"));
|
||||
REQUIRE(std::filesystem::exists("integrated_zero_master.h5"));
|
||||
{
|
||||
HDF5ReadOnlyFile file("integrated_zero.h5");
|
||||
HDF5ReadOnlyFile file("integrated_zero_master.h5");
|
||||
REQUIRE(file.Exists("/entry"));
|
||||
// No data dataset since no images written
|
||||
REQUIRE_THROWS(std::make_unique<HDF5DataSet>(file, "/entry/data/data"));
|
||||
}
|
||||
|
||||
REQUIRE(H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ALL) == 0);
|
||||
remove("integrated_zero.h5");
|
||||
remove("integrated_zero_master.h5");
|
||||
}
|
||||
|
||||
TEST_CASE("HDF5Writer_NXmxIntegrated_AzInt", "[HDF5][Full]") {
|
||||
@@ -1019,9 +1019,9 @@ TEST_CASE("HDF5Writer_NXmxIntegrated_AzInt", "[HDF5][Full]") {
|
||||
REQUIRE(stats.size() == 1);
|
||||
}
|
||||
|
||||
REQUIRE(std::filesystem::exists("integrated_azint.h5"));
|
||||
REQUIRE(std::filesystem::exists("integrated_azint_master.h5"));
|
||||
{
|
||||
HDF5ReadOnlyFile file("integrated_azint.h5");
|
||||
HDF5ReadOnlyFile file("integrated_azint_master.h5");
|
||||
|
||||
// Azimuthal integration bin mapping should exist (written by plugin)
|
||||
std::unique_ptr<HDF5DataSet> dataset;
|
||||
@@ -1035,7 +1035,7 @@ TEST_CASE("HDF5Writer_NXmxIntegrated_AzInt", "[HDF5][Full]") {
|
||||
}
|
||||
|
||||
REQUIRE(H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ALL) == 0);
|
||||
remove("integrated_azint.h5");
|
||||
remove("integrated_azint_master.h5");
|
||||
}
|
||||
|
||||
TEST_CASE("HDF5Writer_NXmxIntegrated_OutOfOrder", "[HDF5][Full]") {
|
||||
@@ -1073,9 +1073,9 @@ TEST_CASE("HDF5Writer_NXmxIntegrated_OutOfOrder", "[HDF5][Full]") {
|
||||
REQUIRE(stats[0].total_images == 5);
|
||||
}
|
||||
|
||||
REQUIRE(std::filesystem::exists("integrated_ooo.h5"));
|
||||
REQUIRE(std::filesystem::exists("integrated_ooo_master.h5"));
|
||||
{
|
||||
HDF5ReadOnlyFile file("integrated_ooo.h5");
|
||||
HDF5ReadOnlyFile file("integrated_ooo_master.h5");
|
||||
std::unique_ptr<HDF5DataSet> dataset;
|
||||
REQUIRE_NOTHROW(dataset = std::make_unique<HDF5DataSet>(file, "/entry/data/data"));
|
||||
HDF5DataSpace file_space(*dataset);
|
||||
@@ -1083,7 +1083,7 @@ TEST_CASE("HDF5Writer_NXmxIntegrated_OutOfOrder", "[HDF5][Full]") {
|
||||
}
|
||||
|
||||
REQUIRE(H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ALL) == 0);
|
||||
remove("integrated_ooo.h5");
|
||||
remove("integrated_ooo_master.h5");
|
||||
}
|
||||
|
||||
TEST_CASE("HDF5Writer_NoMasterFile", "[HDF5][Full]") {
|
||||
|
||||
@@ -12,7 +12,7 @@ ORGY= 1130
|
||||
DETECTOR_DISTANCE= 75
|
||||
OSCILLATION_RANGE= 0.088
|
||||
X-RAY_WAVELENGTH= 1.0
|
||||
NAME_TEMPLATE_OF_DATA_FRAMES=writing_test_??????.h5
|
||||
NAME_TEMPLATE_OF_DATA_FRAMES=single.h5
|
||||
DATA_RANGE= 1 25
|
||||
!DATA_RANGE_FIXED_SCALE_FACTOR= 1900 6000 1.0
|
||||
SPOT_RANGE= 1 25
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
|
||||
namespace {
|
||||
std::string GenFilename(const StartMessage &start) {
|
||||
if (start.file_format == FileWriterFormat::NXmxIntegrated)
|
||||
return fmt::format("{:s}.h5", start.file_prefix);
|
||||
return fmt::format("{:s}_master.h5", start.file_prefix);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user