Skip to content

Commit

Permalink
'std::filesystem' <- 'Poco::File'.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kort Travis committed Nov 8, 2024
1 parent 6093d85 commit 4900459
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Framework/DataHandling/test/H5UtilTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "MantidKernel/System.h"

#include <H5Cpp.h>
#include <Poco/File.h>
#include <boost/numeric/conversion/cast.hpp>
#include <filesystem>
#include <limits>

using namespace H5;
Expand All @@ -29,8 +29,8 @@ class H5UtilTest : public CxxTest::TestSuite {
static void destroySuite(H5UtilTest *suite) { delete suite; }

void removeFile(const std::string &filename) {
if (Poco::File(filename).exists())
Poco::File(filename).remove();
if (std::filesystem::exists(filename))
std::filesystem::remove(filename);
}

void test_strings() {
Expand All @@ -49,7 +49,7 @@ class H5UtilTest : public CxxTest::TestSuite {
file.close();
}

TS_ASSERT(Poco::File(FILENAME).exists());
TS_ASSERT(std::filesystem::exists(FILENAME));
do_assert_simple_string_data_set(FILENAME, GRP_NAME, DATA_NAME, DATA_VALUE);

// cleanup
Expand Down Expand Up @@ -100,7 +100,7 @@ class H5UtilTest : public CxxTest::TestSuite {
}

// Assert
TS_ASSERT(Poco::File(FILENAME).exists());
TS_ASSERT(std::filesystem::exists(FILENAME));
std::map<std::string, float> floatAttributesScalar{{ATTR_NAME_3, ATTR_VALUE_3}};
std::map<std::string, int> intAttributesScalar{{ATTR_NAME_4, ATTR_VALUE_4}};
std::map<std::string, std::vector<float>> floatVectorAttributesScalar{{ATTR_NAME_5, ATTR_VALUE_5}};
Expand Down Expand Up @@ -134,7 +134,7 @@ class H5UtilTest : public CxxTest::TestSuite {
file.close();
}

TS_ASSERT(Poco::File(FILENAME).exists());
TS_ASSERT(std::filesystem::exists(FILENAME));

{ // read tests
H5File file(FILENAME, H5F_ACC_RDONLY);
Expand Down Expand Up @@ -178,7 +178,7 @@ class H5UtilTest : public CxxTest::TestSuite {
file.close();

// check it exists
TS_ASSERT(Poco::File(filename).exists());
TS_ASSERT(std::filesystem::exists(filename));

// open and read the vector
H5File file_read(filename, H5F_ACC_RDONLY);
Expand Down Expand Up @@ -207,7 +207,7 @@ class H5UtilTest : public CxxTest::TestSuite {
g.close();
h5.close();

TS_ASSERT(Poco::File(testInput.fullPath()).exists());
TS_ASSERT(std::filesystem::exists(testInput.fullPath()));
H5File h5_ro(testInput.fullPath(), H5F_ACC_RDONLY);

TS_ASSERT(H5Util::groupExists(h5_ro, "/one"));
Expand Down Expand Up @@ -237,7 +237,7 @@ class H5UtilTest : public CxxTest::TestSuite {
h5.createGroup("/three");
}

TS_ASSERT(Poco::File(testInput.fullPath()).exists());
TS_ASSERT(std::filesystem::exists(testInput.fullPath()));
H5File h5(testInput.fullPath(), H5F_ACC_RDONLY);

Group g1 = h5.openGroup("/one");
Expand Down Expand Up @@ -399,7 +399,7 @@ class H5UtilTest : public CxxTest::TestSuite {
const std::map<std::string, std::vector<float>> &floatVectorAttributes =
std::map<std::string, std::vector<float>>(),
const std::map<std::string, std::vector<int>> &intVectorAttributes = std::map<std::string, std::vector<int>>()) {
TS_ASSERT(Poco::File(filename).exists());
TS_ASSERT(std::filesystem::exists(filename));

// read tests
H5File file(filename, H5F_ACC_RDONLY);
Expand Down

0 comments on commit 4900459

Please sign in to comment.