Generate a temporary path with temp_directory_path and mkstemp
| 38 | |
| 39 | //! Generate a temporary path with temp_directory_path and mkstemp |
| 40 | static std::string TempPath(std::string_view pattern) |
| 41 | { |
| 42 | std::string temp{fs::PathToString(fs::path{fs::temp_directory_path()} / fs::PathFromString(std::string{pattern}))}; |
| 43 | temp.push_back('\0'); |
| 44 | int fd{mkstemp(temp.data())}; |
| 45 | BOOST_CHECK_GE(fd, 0); |
| 46 | BOOST_CHECK_EQUAL(close(fd), 0); |
| 47 | temp.resize(temp.size() - 1); |
| 48 | fs::remove(fs::PathFromString(temp)); |
| 49 | return temp; |
| 50 | } |
| 51 | |
| 52 | //! Unit test that tests execution of IPC calls without actually creating a |
| 53 | //! separate process. This test is primarily intended to verify behavior of type |
no test coverage detected