File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 99#pragma clang diagnostic push
1010#pragma clang diagnostic ignored "-Wdeprecated-declarations"
1111
12- bool test_openCreatesFileWithProperMode ()
12+ void test_openCreatesFileWithProperMode ()
1313{
1414 namespace fs = std::filesystem;
15- const fs::path temp_file = std::tmpnam ( nullptr ) ;
15+ const fs::path temp_file = fs::temp_directory_path () / " test_file_XXXXXX " ;
1616
1717 const int mode = S_IRGRP | S_IROTH | S_IRUSR | S_IWUSR;
1818 const int fd = open (temp_file.c_str (), O_CREAT | O_WRONLY, mode);
@@ -32,7 +32,7 @@ bool test_openCreatesFileWithProperMode()
3232void test_fcntlFlockDiesWhenRealtime ()
3333{
3434 namespace fs = std::filesystem;
35- const fs::path temp_file = std::tmpnam ( nullptr ) ;
35+ const fs::path temp_file = fs::temp_directory_path () / " test_file_XXXXXX " ;
3636 int fd = creat (temp_file.c_str (), S_IRUSR | S_IWUSR);
3737 assert (fd != -1 );
3838
@@ -48,6 +48,8 @@ void test_fcntlFlockDiesWhenRealtime()
4848 assert (lock.l_type == F_UNLCK);
4949 };
5050
51+ func ();
52+
5153 close (fd);
5254 std::remove (temp_file.c_str ());
5355}
You can’t perform that action at this time.
0 commit comments