[Bf-blender-cvs] [0e1da8dd120] master: In obj exporter test, fix a strncpy length and a stray test file left behind.

Howard Trickey noreply at git.blender.org
Wed Jan 5 23:10:54 CET 2022


Commit: 0e1da8dd120d1d2b4f699087b102ce0573ed90be
Author: Howard Trickey
Date:   Wed Jan 5 17:04:47 2022 -0500
Branches: master
https://developer.blender.org/rB0e1da8dd120d1d2b4f699087b102ce0573ed90be

In obj exporter test, fix a strncpy length and a stray test file left behind.

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

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 f12bfd0cea5..0feca806f35 100644
--- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
+++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
@@ -229,6 +229,7 @@ TEST(obj_exporter_writer, mtllib)
   }
   const std::string result = read_temp_file_in_string(out_file_path);
   ASSERT_EQ(result, "mtllib blah.mtl\nmtllib blah.mtl\n");
+  BLI_delete(out_file_path.c_str(), false, false);
 }
 
 /* Return true if string #a and string #b are equal after their first newline. */
@@ -286,7 +287,7 @@ class obj_exporter_regression_test : public obj_exporter_test {
     BKE_tempdir_init(NULL);
     std::string tempdir = std::string(BKE_tempdir_base());
     std::string out_file_path = tempdir + BLI_path_basename(golden_obj.c_str());
-    strncpy(params.filepath, out_file_path.c_str(), FILE_MAX);
+    strncpy(params.filepath, out_file_path.c_str(), FILE_MAX - 1);
     params.blen_filepath = blendfile.c_str();
     export_frame(depsgraph, params, out_file_path.c_str());
     std::string output_str = read_temp_file_in_string(out_file_path);



More information about the Bf-blender-cvs mailing list