| 66 | } |
| 67 | |
| 68 | pair<int, path> OpenTempFile() |
| 69 | { |
| 70 | const string filename = |
| 71 | string(test_data_temp_path) + "/piscsi_test-XXXXXX"; // NOSONAR Publicly writable directory is fine here |
| 72 | vector<char> f(filename.begin(), filename.end()); |
| 73 | f.push_back(0); |
| 74 | |
| 75 | create_directories(path(filename).parent_path()); |
| 76 | |
| 77 | const int fd = mkstemp(f.data()); |
| 78 | EXPECT_NE(-1, fd) << "Couldn't create temporary file '" << f.data() << "'"; |
| 79 | |
| 80 | return make_pair(fd, path(f.data())); |
| 81 | } |
| 82 | |
| 83 | path CreateTempFile(int size) |
| 84 | { |
no outgoing calls
no test coverage detected