mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-06 03:47:13 +00:00
test: close the OBJ file before removing it so the test passes on Windows
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -344,9 +344,11 @@ TEST_F(RawTest, WritesTheTerrainMeshAsObj) {
|
|||||||
const auto path = (std::filesystem::temp_directory_path() / "dlu_raw_test.obj").string();
|
const auto path = (std::filesystem::temp_directory_path() / "dlu_raw_test.obj").string();
|
||||||
ASSERT_TRUE(Raw::WriteTerrainMeshToOBJ(mesh, path));
|
ASSERT_TRUE(Raw::WriteTerrainMeshToOBJ(mesh, path));
|
||||||
|
|
||||||
std::ifstream file(path);
|
|
||||||
std::vector<std::string> lines;
|
std::vector<std::string> lines;
|
||||||
for (std::string line; std::getline(file, line);) lines.push_back(line);
|
{
|
||||||
|
std::ifstream file(path);
|
||||||
|
for (std::string line; std::getline(file, line);) lines.push_back(line);
|
||||||
|
} // closed before removing it (Windows can't remove an open file)
|
||||||
std::filesystem::remove(path);
|
std::filesystem::remove(path);
|
||||||
|
|
||||||
ASSERT_EQ(lines.size(), 4);
|
ASSERT_EQ(lines.size(), 4);
|
||||||
|
|||||||
Reference in New Issue
Block a user