[Bf-blender-cvs] [ab97b22a1a6] soc-2020-io-performance: Create test OBJ files in temporary place.

Howard Trickey noreply at git.blender.org
Sun Apr 18 22:16:30 CEST 2021


Commit: ab97b22a1a6db8557605dce67f808b8638979e4e
Author: Howard Trickey
Date:   Sun Apr 18 15:59:37 2021 -0400
Branches: soc-2020-io-performance
https://developer.blender.org/rBab97b22a1a6db8557605dce67f808b8638979e4e

Create test OBJ files in temporary place.

===================================================================

M	source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc

===================================================================

diff --git a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
index 3aa405f5b86..f3603a741f1 100644
--- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
+++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
@@ -187,7 +187,7 @@ static std::unique_ptr<OBJWriter> init_writer(const OBJExportParams &params,
 }
 
 /* The following is relative to the flags_test_release_dir(). */
-const char *const temp_file_path = "Testing/output.OBJ";
+const char *const temp_file_path = "../../Testing/Temporary/output.OBJ";
 
 static std::string read_temp_file_in_string(const std::string &file_path)
 {
@@ -199,26 +199,27 @@ static std::string read_temp_file_in_string(const std::string &file_path)
 
 TEST(obj_exporter_writer, header)
 {
+  std::string out_file_path = blender::tests::flags_test_release_dir() + "/" + temp_file_path;
   {
     OBJExportParamsDefault _export;
-    std::string out_file_path = blender::tests::flags_test_release_dir() + "/" + temp_file_path;
-    std::unique_ptr<OBJWriter> writer = init_writer(_export.params, temp_file_path);
+    std::unique_ptr<OBJWriter> writer = init_writer(_export.params, out_file_path);
     if (!writer) {
       ADD_FAILURE();
       return;
     }
     writer->write_header();
   }
-  const std::string result = read_temp_file_in_string(temp_file_path);
+  const std::string result = read_temp_file_in_string(out_file_path);
   using namespace std::string_literals;
   ASSERT_EQ(result, "# Blender "s + BKE_blender_version_string() + "\n" + "# www.blender.org\n");
 }
 
 TEST(obj_exporter_writer, mtllib)
 {
+  std::string out_file_path = blender::tests::flags_test_release_dir() + "/" + temp_file_path;
   {
     OBJExportParamsDefault _export;
-    std::unique_ptr<OBJWriter> writer = init_writer(_export.params, temp_file_path);
+    std::unique_ptr<OBJWriter> writer = init_writer(_export.params, out_file_path);
     if (!writer) {
       ADD_FAILURE();
       return;
@@ -226,7 +227,7 @@ TEST(obj_exporter_writer, mtllib)
     writer->write_mtllib_name("/Users/blah.mtl");
     writer->write_mtllib_name("\\C:\\blah.mtl");
   }
-  const std::string result = read_temp_file_in_string(temp_file_path);
+  const std::string result = read_temp_file_in_string(out_file_path);
   ASSERT_EQ(result, "mtllib blah.mtl\nmtllib blah.mtl\n");
 }



More information about the Bf-blender-cvs mailing list