Commit: 322555faa31de2e5bbfa062e9bf132a8d69b3ca6 Author: Sybren A. Stüvel Date: Fri Dec 13 14:33:25 2019 +0100 Branches: master https://developer.blender.org/rB322555faa31de2e5bbfa062e9bf132a8d69b3ca6
USD: Remove file created in unit test after the test is done No functional changes in the USD exporter, just some cleanup code added to the unit test. =================================================================== M tests/gtests/usd/usd_stage_creation_test.cc =================================================================== diff --git a/tests/gtests/usd/usd_stage_creation_test.cc b/tests/gtests/usd/usd_stage_creation_test.cc index fcf1e93ea7d..9d76b42371d 100644 --- a/tests/gtests/usd/usd_stage_creation_test.cc +++ b/tests/gtests/usd/usd_stage_creation_test.cc @@ -41,7 +41,7 @@ TEST_F(USDStageCreationTest, JSONFileLoadingTest) std::string filename = "usd-stage-creation-test.usdc"; if (FLAGS_test_blender_executable_dir.empty()) { - FAIL() << "Pass the flag"; + FAIL() << "Pass the --test-blender-executable-dir flag"; } /* Required on Linux to make BKE_appdir_folder_id() find the datafiles. @@ -64,9 +64,18 @@ TEST_F(USDStageCreationTest, JSONFileLoadingTest) usd_initialise_plugin_path(usd_datafiles_abspath); - /* Simply the ability to create a USD Stage for a specific filename means that the extension has - * been recognised by the USD library, and that a USD plugin has been loaded to write such files. - * Practically, this is a test to see whether the USD JSON files can be found and loaded. */ + /* Simply the ability to create a USD Stage for a specific filename means that the extension + * has been recognised by the USD library, and that a USD plugin has been loaded to write such + * files. Practically, this is a test to see whether the USD JSON files can be found and + * loaded. */ pxr::UsdStageRefPtr usd_stage = pxr::UsdStage::CreateNew(filename); - EXPECT_TRUE(usd_stage) << "unable to find suitable USD plugin to write " << filename; + if (usd_stage != nullptr) { + /* Even though we don't call usd_stage->SaveFile(), a file is still created on the filesystem + * when we call CreateNew(). It's immediately closed, though, so we can safely call unlink() + * here. */ + unlink(filename.c_str()); + } + else { + FAIL() << "unable to find suitable USD plugin to write " << filename; + } } _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs