diff options
Diffstat (limited to 'test/fslock.cpp')
-rw-r--r-- | test/fslock.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/test/fslock.cpp b/test/fslock.cpp index 1c1dcb6a..883c4b0e 100644 --- a/test/fslock.cpp +++ b/test/fslock.cpp @@ -95,7 +95,8 @@ TEST_CASE("try_lock() returns an error if lock-file permissions or location are GIVEN("A lock file which does not grant write access") { const test_helpers::TempFile lock_location; - const int fd = ::open(lock_location.get_path().c_str(), O_RDWR | O_CREAT, 0400); + const int fd = ::open(lock_location.get_path().to_locale_string().c_str(), + O_RDWR | O_CREAT, 0400); ::close(fd); THEN("try_lock() will fail and return pid == 0") { @@ -144,7 +145,7 @@ TEST_CASE("try_lock() succeeds if lock file location is valid and not locked by REQUIRE(lock.try_lock(lock_location.get_path(), pid, error_message)); SECTION("The lock file exists after a call to try_lock()") { - REQUIRE(0 == ::access(lock_location.get_path().c_str(), F_OK)); + REQUIRE(0 == ::access(lock_location.get_path().to_locale_string().c_str(), F_OK)); } SECTION("Calling try_lock() a second time for the same location succeeds") { @@ -154,10 +155,10 @@ TEST_CASE("try_lock() succeeds if lock file location is valid and not locked by SECTION("Calling try_lock() a second time with a different location succeeds and cleans up old lock file") { const test_helpers::TempFile new_lock_location; - REQUIRE(0 == ::access(lock_location.get_path().c_str(), F_OK)); + REQUIRE(0 == ::access(lock_location.get_path().to_locale_string().c_str(), F_OK)); REQUIRE(lock.try_lock(new_lock_location.get_path(), pid, error_message)); - REQUIRE(0 != ::access(lock_location.get_path().c_str(), F_OK)); - REQUIRE(0 == ::access(new_lock_location.get_path().c_str(), F_OK)); + REQUIRE(0 != ::access(lock_location.get_path().to_locale_string().c_str(), F_OK)); + REQUIRE(0 == ::access(new_lock_location.get_path().to_locale_string().c_str(), F_OK)); } } |