diff --git a/docs/毕设/~$大学本科生毕业论文(设计)参考模板(2024315).doc b/docs/毕设/~$大学本科生毕业论文(设计)参考模板(2024315).doc deleted file mode 100644 index c0459ad2..00000000 Binary files a/docs/毕设/~$大学本科生毕业论文(设计)参考模板(2024315).doc and /dev/null differ diff --git a/tests/Rendering/unit/test_render_resource_cache.cpp b/tests/Rendering/unit/test_render_resource_cache.cpp index e624abfa..a3d78532 100644 --- a/tests/Rendering/unit/test_render_resource_cache.cpp +++ b/tests/Rendering/unit/test_render_resource_cache.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include using namespace XCEngine::Math; @@ -402,9 +403,28 @@ GaussianSplat BuildSampleGaussianSplat(const char* artifactPath) { return gaussianSplat; } -std::filesystem::path CreateTestProjectRoot(const char* folderName) { - return std::filesystem::current_path() / "__xc_gaussian_splat_cache_test_runtime" / folderName; -} +class ScopedTestProjectRoot final { +public: + explicit ScopedTestProjectRoot(const char* folderName) + : m_runtimeRoot(std::filesystem::temp_directory_path() / "xcengine_gaussian_splat_cache_test_runtime") + , m_projectRoot(m_runtimeRoot / folderName) { + std::error_code ec; + std::filesystem::remove_all(m_projectRoot, ec); + } + + ~ScopedTestProjectRoot() { + std::error_code ec; + std::filesystem::remove_all(m_runtimeRoot, ec); + } + + const std::filesystem::path& GetPath() const { + return m_projectRoot; + } + +private: + std::filesystem::path m_runtimeRoot; + std::filesystem::path m_projectRoot; +}; TEST(RenderResourceCacheTest, GetOrCreateGaussianSplatUploadsStructuredSectionsAndReusesEntry) { GaussianSplat gaussianSplat = BuildSampleGaussianSplat("sample.xcgsplat"); @@ -507,7 +527,8 @@ TEST(RenderResourceCacheTest, GetOrCreateGaussianSplatSupportsArtifactRuntimeLoa TEST(RenderResourceCacheTest, GetOrCreateGaussianSplatSupportsSourceAssetImportPath) { namespace fs = std::filesystem; - const fs::path projectRoot = CreateTestProjectRoot("source_asset_import"); + const ScopedTestProjectRoot testProjectRoot("source_asset_import"); + const fs::path projectRoot = testProjectRoot.GetPath(); const fs::path assetsDir = projectRoot / "Assets"; const fs::path sourcePath = assetsDir / "sample.ply"; diff --git a/tests/Resources/GaussianSplat/test_gaussian_splat_loader.cpp b/tests/Resources/GaussianSplat/test_gaussian_splat_loader.cpp index baf05627..dfa683fa 100644 --- a/tests/Resources/GaussianSplat/test_gaussian_splat_loader.cpp +++ b/tests/Resources/GaussianSplat/test_gaussian_splat_loader.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -273,9 +274,28 @@ GaussianSplat BuildSampleGaussianSplat(const char* artifactPath) { return gaussianSplat; } -std::filesystem::path CreateTestProjectRoot(const char* folderName) { - return std::filesystem::current_path() / "__xc_gaussian_splat_test_runtime" / folderName; -} +class ScopedTestProjectRoot final { +public: + explicit ScopedTestProjectRoot(const char* folderName) + : m_runtimeRoot(std::filesystem::temp_directory_path() / "xcengine_gaussian_splat_test_runtime") + , m_projectRoot(m_runtimeRoot / folderName) { + std::error_code ec; + std::filesystem::remove_all(m_projectRoot, ec); + } + + ~ScopedTestProjectRoot() { + std::error_code ec; + std::filesystem::remove_all(m_runtimeRoot, ec); + } + + const std::filesystem::path& GetPath() const { + return m_projectRoot; + } + +private: + std::filesystem::path m_runtimeRoot; + std::filesystem::path m_projectRoot; +}; void LinkOrCopyFixture(const std::filesystem::path& sourcePath, const std::filesystem::path& destinationPath) { std::error_code ec; @@ -407,7 +427,8 @@ TEST(GaussianSplatLoader, ResourceManagerLoadsArtifactByPath) { TEST(GaussianSplatLoader, AssetDatabaseImportsSyntheticPlyAndLinearizesData) { namespace fs = std::filesystem; - const fs::path projectRoot = CreateTestProjectRoot("gaussian_splat_synthetic_import"); + const ScopedTestProjectRoot testProjectRoot("gaussian_splat_synthetic_import"); + const fs::path projectRoot = testProjectRoot.GetPath(); const fs::path assetsDir = projectRoot / "Assets"; const fs::path sourcePath = assetsDir / "sample.ply"; @@ -520,7 +541,8 @@ TEST(GaussianSplatLoader, RoomPlyBuildsArtifactAndLoadsThroughResourceManager) { const XCEngine::Core::uint32 expectedChunkCount = (expectedVertexCount + kGaussianSplatChunkSize - 1u) / kGaussianSplatChunkSize; - const fs::path projectRoot = CreateTestProjectRoot("gaussian_splat_room_import"); + const ScopedTestProjectRoot testProjectRoot("gaussian_splat_room_import"); + const fs::path projectRoot = testProjectRoot.GetPath(); const fs::path assetsDir = projectRoot / "Assets"; const fs::path roomPath = assetsDir / "room.ply";