From 0e1da8dd120d1d2b4f699087b102ce0573ed90be Mon Sep 17 00:00:00 2001 From: Howard Trickey Date: Wed, 5 Jan 2022 17:04:47 -0500 Subject: In obj exporter test, fix a strncpy length and a stray test file left behind. --- source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/io/wavefront_obj') 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); -- cgit v1.2.3