Avoid use of platform-specific `unistd.h` header
This commit is contained in:
parent
cb93d6900c
commit
522aa4359e
|
@ -21,10 +21,9 @@ using namespace CppUtilities;
|
||||||
#include <cppunit/extensions/HelperMacros.h>
|
#include <cppunit/extensions/HelperMacros.h>
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <filesystem>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace CppUtilities::Literals;
|
using namespace CppUtilities::Literals;
|
||||||
using namespace TagParser;
|
using namespace TagParser;
|
||||||
|
@ -335,8 +334,7 @@ void UtilitiesTests::testBackupFile()
|
||||||
// get rid of 2nd backup (again)
|
// get rid of 2nd backup (again)
|
||||||
backupStream2.close();
|
backupStream2.close();
|
||||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("remove " + backupPath2, 0, remove(backupPath2.data()));
|
CPPUNIT_ASSERT_EQUAL_MESSAGE("remove " + backupPath2, 0, remove(backupPath2.data()));
|
||||||
const auto backupDir(workingDir + "/bak");
|
std::filesystem::remove_all(workingDir + "/bak");
|
||||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("remove " + backupDir, 0, rmdir(backupDir.data()));
|
|
||||||
|
|
||||||
// should be able to use backup stream, eg. seek to the end
|
// should be able to use backup stream, eg. seek to the end
|
||||||
backupStream1.seekg(0, ios_base::end);
|
backupStream1.seekg(0, ios_base::end);
|
||||||
|
|
Loading…
Reference in New Issue