18
18
#include " MantidDataObjects/EventWorkspace.h"
19
19
#include " MantidKernel/DateAndTime.h"
20
20
#include " MantidKernel/TimeSeriesProperty.h"
21
- #include < boost/ filesystem.hpp >
21
+ #include < filesystem>
22
22
#include < fstream>
23
23
24
24
using Mantid::Algorithms::CorelliCalibrationDatabase;
@@ -50,11 +50,11 @@ class CorelliCalibrationDatabaseTest : public CxxTest::TestSuite {
50
50
void test_file_io () {
51
51
// create directory
52
52
std::string test_dir{" TestCorelliCalibrationX" };
53
- boost ::filesystem::create_directory (test_dir);
54
- TS_ASSERT (boost ::filesystem::is_directory (test_dir));
53
+ std ::filesystem::create_directory (test_dir);
54
+ TS_ASSERT (std ::filesystem::is_directory (test_dir));
55
55
56
56
// clean
57
- boost ::filesystem::remove_all (test_dir);
57
+ std ::filesystem::remove_all (test_dir);
58
58
}
59
59
60
60
// -----------------------------------------------------------------------------
@@ -125,20 +125,20 @@ class CorelliCalibrationDatabaseTest : public CxxTest::TestSuite {
125
125
// component file: name, remove file if it does exist, save and check file
126
126
// existence
127
127
const std::string testcalibtablefilename{" /tmp/testsourcedb2.csv" };
128
- boost ::filesystem::remove (testcalibtablefilename);
128
+ std ::filesystem::remove (testcalibtablefilename);
129
129
calib_handler.saveCalibrationTable (testcalibtablefilename);
130
- TS_ASSERT (boost ::filesystem::exists (testcalibtablefilename));
130
+ TS_ASSERT (std ::filesystem::exists (testcalibtablefilename));
131
131
// load file and check
132
132
TableWorkspace_sptr duptable = loadCSVtoTable (testcalibtablefilename, " DuplicatedSource" );
133
133
TS_ASSERT_EQUALS (duptable->rowCount (), 3 );
134
134
TS_ASSERT_DELTA (duptable->cell <double >(2 , 6 ), 0.3424 , 0.00001 );
135
135
136
136
// Test: save single component file
137
137
const std::string testsamplecalfilename{" /tmp/testsampledb2.csv" };
138
- boost ::filesystem::remove (testsamplecalfilename);
138
+ std ::filesystem::remove (testsamplecalfilename);
139
139
// save
140
140
calib_handler.saveCompomentDatabase (" 20201117" , " sample-position" , testsamplecalfilename);
141
- TS_ASSERT (boost ::filesystem::exists (testsamplecalfilename));
141
+ TS_ASSERT (std ::filesystem::exists (testsamplecalfilename));
142
142
143
143
// load
144
144
TableWorkspace_sptr dupsampletable =
@@ -162,9 +162,9 @@ class CorelliCalibrationDatabaseTest : public CxxTest::TestSuite {
162
162
// create directory database
163
163
std::string calibdir{" /tmp/TestCorelliCalibration1117" };
164
164
// clean previous
165
- boost ::filesystem::remove_all (calibdir);
165
+ std ::filesystem::remove_all (calibdir);
166
166
// create data base
167
- boost ::filesystem::create_directory (calibdir);
167
+ std ::filesystem::create_directory (calibdir);
168
168
// create a previously generated database file
169
169
// will create the following files:
170
170
// moderator.csv, sample-position.csv, bank2.csv, bank42.csv
@@ -206,11 +206,11 @@ class CorelliCalibrationDatabaseTest : public CxxTest::TestSuite {
206
206
TS_ASSERT_EQUALS (combinedcalibws->cell <std::string>(4 , 0 ), " bank42/sixteenpack" );
207
207
208
208
// Output 2: search the saved output calibration file
209
- boost ::filesystem::path pdir (calibdir);
210
- boost ::filesystem::path pbase (" corelli_instrument_20201117.csv" );
211
- boost ::filesystem::path ptodaycalfile = pdir / pbase;
209
+ std ::filesystem::path pdir (calibdir);
210
+ std ::filesystem::path pbase (" corelli_instrument_20201117.csv" );
211
+ std ::filesystem::path ptodaycalfile = pdir / pbase;
212
212
std::string todaycalfile = ptodaycalfile.string ();
213
- TS_ASSERT (boost ::filesystem::exists (todaycalfile));
213
+ TS_ASSERT (std ::filesystem::exists (todaycalfile));
214
214
// load and compare
215
215
// ... ...
216
216
@@ -341,13 +341,13 @@ class CorelliCalibrationDatabaseTest : public CxxTest::TestSuite {
341
341
*/
342
342
void create_existing_database_files (const std::string &calibdir, std::vector<std::string> &banks) {
343
343
344
- boost ::filesystem::path dir (calibdir);
344
+ std ::filesystem::path dir (calibdir);
345
345
346
346
for (auto bankname : banks) {
347
347
// create full path database name
348
348
std::string basename = bankname + " .csv" ;
349
- boost ::filesystem::path basepath (basename);
350
- boost ::filesystem::path fullpath = dir / basename;
349
+ std ::filesystem::path basepath (basename);
350
+ std ::filesystem::path fullpath = dir / basename;
351
351
std::string filename = fullpath.string ();
352
352
// write file
353
353
std::ofstream bankofs (filename, std::ofstream::out);
@@ -369,13 +369,13 @@ class CorelliCalibrationDatabaseTest : public CxxTest::TestSuite {
369
369
void verify_component_files (const std::string &calfiledir, const std::string &component,
370
370
size_t expectedrecordsnumber) {
371
371
// Create full file path
372
- boost ::filesystem::path pdir (calfiledir);
373
- boost ::filesystem::path pbase (component + " .csv" );
374
- boost ::filesystem::path pcompcalfile = pdir / pbase;
372
+ std ::filesystem::path pdir (calfiledir);
373
+ std ::filesystem::path pbase (component + " .csv" );
374
+ std ::filesystem::path pcompcalfile = pdir / pbase;
375
375
std::string compcalfile = pcompcalfile.string ();
376
376
377
377
// Assert file existence
378
- TS_ASSERT (boost ::filesystem::exists (compcalfile));
378
+ TS_ASSERT (std ::filesystem::exists (compcalfile));
379
379
380
380
// Load table
381
381
TableWorkspace_sptr tablews = loadCSVtoTable (compcalfile, " CorelliVerify_" + component);
0 commit comments