Avoid use of platform-specific `unistd.h` header

This commit is contained in:
Martchus 2023-02-11 13:55:04 +01:00
parent cb93d6900c
commit 522aa4359e
1 changed files with 2 additions and 4 deletions

View File

@ -21,10 +21,9 @@ using namespace CppUtilities;
#include <cppunit/extensions/HelperMacros.h>
#include <cstdio>
#include <filesystem>
#include <regex>
#include <unistd.h>
using namespace std;
using namespace CppUtilities::Literals;
using namespace TagParser;
@ -335,8 +334,7 @@ void UtilitiesTests::testBackupFile()
// get rid of 2nd backup (again)
backupStream2.close();
CPPUNIT_ASSERT_EQUAL_MESSAGE("remove " + backupPath2, 0, remove(backupPath2.data()));
const auto backupDir(workingDir + "/bak");
CPPUNIT_ASSERT_EQUAL_MESSAGE("remove " + backupDir, 0, rmdir(backupDir.data()));
std::filesystem::remove_all(workingDir + "/bak");
// should be able to use backup stream, eg. seek to the end
backupStream1.seekg(0, ios_base::end);