[Bf-blender-cvs] [e5a97df7b52] soc-2020-io-performance: Cleanup tests: move default to header, add failures.

Ankit Meel noreply at git.blender.org
Mon Nov 16 15:33:30 CET 2020


Commit: e5a97df7b52aa681291f365fba60df2e68b6e452
Author: Ankit Meel
Date:   Mon Nov 16 18:43:41 2020 +0530
Branches: soc-2020-io-performance
https://developer.blender.org/rBe5a97df7b52aa681291f365fba60df2e68b6e452

Cleanup tests: move default to header, add failures.

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

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

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

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 1e65631e940..bd1171ac22f 100644
--- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
+++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
@@ -44,6 +44,7 @@ TEST_F(Export_OBJ, filter_objects_curves_as_mesh)
 {
   OBJExportParamsDefault _export;
   if (!load_file_and_depsgraph(all_objects_file)) {
+    ADD_FAILURE();
     return;
   }
 
@@ -56,6 +57,7 @@ TEST_F(Export_OBJ, filter_objects_curves_as_nurbs)
 {
   OBJExportParamsDefault _export;
   if (!load_file_and_depsgraph(all_objects_file)) {
+    ADD_FAILURE();
     return;
   }
   _export.params.export_curves_as_nurbs = true;
@@ -68,6 +70,7 @@ TEST_F(Export_OBJ, filter_objects_selected)
 {
   OBJExportParamsDefault _export;
   if (!load_file_and_depsgraph(all_objects_file)) {
+    ADD_FAILURE();
     return;
   }
   _export.params.export_selected_objects = true;
@@ -102,16 +105,9 @@ TEST(Export_OBJ_utils, append_positive_frame_to_filename)
 TEST_F(Export_OBJ, OBJCurve)
 {
   if (!load_file_and_depsgraph(all_curve_objects_file)) {
+    ADD_FAILURE();
     return;
   }
-  const std::map<std::string, std::unique_ptr<NurbsObject>> all_nurbs_truth = []() {
-    std::map<std::string, std::unique_ptr<NurbsObject>> t;
-    t.emplace("NurbsCurve", std::make_unique<NurbsObject>("NurbsCurve", coordinates_NurbsCurve));
-    t.emplace("NurbsCircle",
-              std::make_unique<NurbsObject>("NurbsCircle", coordinates_NurbsCircle));
-    t.emplace("NurbsPath", std::make_unique<NurbsObject>("NurbsPath", coordinates_NurbsPath));
-    return t;
-  }();
 
   OBJExportParamsDefault _export;
   _export.params.export_curves_as_nurbs = true;
diff --git a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.hh b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.hh
index 3d655e228c9..39b4ec33894 100644
--- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.hh
+++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.hh
@@ -107,4 +107,15 @@ const std::vector<std::vector<array_float_3>> coordinates_NurbsPath{
      {16.688307, 0.000000, 1.000000},
      {14.688307, 0.000000, 1.000000},
      {14.188307, 0.000000, 0.000000}}};
+
+const std::map<std::string, std::unique_ptr<NurbsObject>> all_nurbs_truth = []() {
+  std::map<std::string, std::unique_ptr<NurbsObject>> all_nurbs;
+  all_nurbs.emplace("NurbsCurve",
+                    std::make_unique<NurbsObject>("NurbsCurve", coordinates_NurbsCurve));
+  all_nurbs.emplace("NurbsCircle",
+                    std::make_unique<NurbsObject>("NurbsCircle", coordinates_NurbsCircle));
+  all_nurbs.emplace("NurbsPath",
+                    std::make_unique<NurbsObject>("NurbsPath", coordinates_NurbsPath));
+  return all_nurbs;
+}();
 }  // namespace blender::io::obj



More information about the Bf-blender-cvs mailing list