[Bf-blender-cvs] [d1492ebb6de] soc-2020-io-performance: cleanup: move defaults to header file; renaming.

Ankit Meel noreply at git.blender.org
Mon Nov 16 11:15:57 CET 2020


Commit: d1492ebb6de8b3b25461c978fd7dab137b21fbd8
Author: Ankit Meel
Date:   Sat Nov 14 04:11:04 2020 +0530
Branches: soc-2020-io-performance
https://developer.blender.org/rBd1492ebb6de8b3b25461c978fd7dab137b21fbd8

cleanup: move defaults to header file; renaming.

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

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 1cc5953842f..50b73da7f27 100644
--- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
+++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
@@ -38,35 +38,6 @@ class Export_OBJ : public BlendfileLoadingBaseTest {
   }
 };
 
-struct OBJExportParamsDefault {
-  OBJExportParams params;
-  OBJExportParamsDefault()
-  {
-    params.filepath[0] = '\0';
-    params.export_animation = false;
-    params.start_frame = 0;
-    params.end_frame = 1;
-
-    params.forward_axis = OBJ_AXIS_NEGATIVE_Z_FORWARD;
-    params.up_axis = OBJ_AXIS_Y_UP;
-    params.scaling_factor = 1.f;
-
-    params.export_eval_mode = DAG_EVAL_VIEWPORT;
-    params.export_selected_objects = false;
-    params.export_uv = true;
-    params.export_normals = true;
-    params.export_materials = true;
-    params.export_triangulated_mesh = false;
-    params.export_curves_as_nurbs = false;
-
-    params.export_object_groups = false;
-    params.export_material_groups = false;
-    params.export_vertex_groups = false;
-    params.export_smooth_groups = true;
-    params.smooth_groups_bitflags = false;
-  }
-};
-
 const std::string all_objects_file = "io_tests/blend_scene/all_objects_2_92.blend";
 const std::string all_curve_objects_file = "io_tests/blend_scene/all_curves_2_92.blend";
 
@@ -110,23 +81,23 @@ TEST_F(Export_OBJ, filter_objects_selected)
 TEST(Export_OBJ_utils, append_negative_frame_to_filename)
 {
   const char path_original[FILE_MAX] = "/my_file.obj";
-  const char path_expected[FILE_MAX] = "/my_file-123.obj";
+  const char path_truth[FILE_MAX] = "/my_file-123.obj";
   const int frame = -123;
   char path_with_frame[FILE_MAX] = {0};
   const bool ok = append_frame_to_filename(path_original, frame, path_with_frame);
   EXPECT_TRUE(ok);
-  EXPECT_EQ_ARRAY(path_with_frame, path_expected, BLI_strlen_utf8(path_expected));
+  EXPECT_EQ_ARRAY(path_with_frame, path_truth, BLI_strlen_utf8(path_truth));
 }
 
 TEST(Export_OBJ_utils, append_positive_frame_to_filename)
 {
   const char path_original[FILE_MAX] = "/my_file.obj";
-  const char path_expected[FILE_MAX] = "/my_file123.obj";
+  const char path_truth[FILE_MAX] = "/my_file123.obj";
   const int frame = 123;
   char path_with_frame[FILE_MAX] = {0};
   const bool ok = append_frame_to_filename(path_original, frame, path_with_frame);
   EXPECT_TRUE(ok);
-  EXPECT_EQ_ARRAY(path_with_frame, path_expected, BLI_strlen_utf8(path_expected));
+  EXPECT_EQ_ARRAY(path_with_frame, path_truth, BLI_strlen_utf8(path_truth));
 }
 
 TEST_F(Export_OBJ, OBJCurve)
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 720ee873a30..064b8d95ec5 100644
--- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.hh
+++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.hh
@@ -48,6 +48,35 @@ class NurbsObject {
   }
 };
 
+struct OBJExportParamsDefault {
+  OBJExportParams params;
+  OBJExportParamsDefault()
+  {
+    params.filepath[0] = '\0';
+    params.export_animation = false;
+    params.start_frame = 0;
+    params.end_frame = 1;
+
+    params.forward_axis = OBJ_AXIS_NEGATIVE_Z_FORWARD;
+    params.up_axis = OBJ_AXIS_Y_UP;
+    params.scaling_factor = 1.f;
+
+    params.export_eval_mode = DAG_EVAL_VIEWPORT;
+    params.export_selected_objects = false;
+    params.export_uv = true;
+    params.export_normals = true;
+    params.export_materials = true;
+    params.export_triangulated_mesh = false;
+    params.export_curves_as_nurbs = false;
+
+    params.export_object_groups = false;
+    params.export_material_groups = false;
+    params.export_vertex_groups = false;
+    params.export_smooth_groups = true;
+    params.smooth_groups_bitflags = false;
+  }
+};
+
 const std::vector<std::vector<arr_float_3>> coordinates_NurbsCurve{
     {{9.947419, 0.000000, 0.000000},
      {9.447419, 0.000000, 1.000000},



More information about the Bf-blender-cvs mailing list