[Bf-blender-cvs] [7859e3c280f] soc-2020-io-performance: Cleanup: renames, comments.

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


Commit: 7859e3c280f0f6159d9aa4a66efe74658fde35f8
Author: Ankit Meel
Date:   Sat Nov 14 18:41:55 2020 +0530
Branches: soc-2020-io-performance
https://developer.blender.org/rB7859e3c280f0f6159d9aa4a66efe74658fde35f8

Cleanup: renames, comments.

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

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 50b73da7f27..79d54b5f410 100644
--- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
+++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
@@ -13,7 +13,6 @@
 
 #include "DEG_depsgraph.h"
 
-#include "IO_wavefront_obj.h"
 #include "obj_export_mesh.hh"
 #include "obj_export_nurbs.hh"
 #include "obj_exporter.hh"
@@ -41,7 +40,7 @@ class Export_OBJ : public BlendfileLoadingBaseTest {
 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";
 
-TEST_F(Export_OBJ, filter_objects_as_mesh)
+TEST_F(Export_OBJ, filter_objects_curves_as_mesh)
 {
   OBJExportParamsDefault _export;
   if (!load_file_and_depsgraph(all_objects_file)) {
@@ -53,7 +52,7 @@ TEST_F(Export_OBJ, filter_objects_as_mesh)
   EXPECT_EQ(objcurves.size(), 0);
 }
 
-TEST_F(Export_OBJ, filter_objects_as_curves)
+TEST_F(Export_OBJ, filter_objects_curves_as_nurbs)
 {
   OBJExportParamsDefault _export;
   if (!load_file_and_depsgraph(all_objects_file)) {
@@ -128,11 +127,11 @@ TEST_F(Export_OBJ, OBJCurve)
     for (int spline_index : IndexRange(objcurve->total_splines())) {
       EXPECT_EQ(objcurve->total_nurbs_points(spline_index),
                 nurbs_truth->total_nurbs_points(spline_index));
-      for (int vertex : IndexRange(objcurve->total_nurbs_points(spline_index))) {
-        EXPECT_V3_NEAR(
-            objcurve->get_nurbs_point_coords(spline_index, vertex, _export.params.scaling_factor),
-            nurbs_truth->get_nurbs_point_coords(spline_index, vertex),
-            0.000001f);
+      for (int vertex_index : IndexRange(objcurve->total_nurbs_points(spline_index))) {
+        EXPECT_V3_NEAR(objcurve->get_nurbs_point_coords(
+                           spline_index, vertex_index, _export.params.scaling_factor),
+                       nurbs_truth->get_nurbs_point_coords(spline_index, vertex_index),
+                       0.000001f);
       }
     }
   }
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 064b8d95ec5..56464aa1eb5 100644
--- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.hh
+++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.hh
@@ -12,18 +12,24 @@
 #include <string>
 #include <vector>
 
+#include "IO_wavefront_obj.h"
+
 namespace blender::io::obj {
 
-using arr_float_3 = std::array<float, 3>;
+using array_float_3 = std::array<float, 3>;
 
+/**
+ * This matches OBJCurve's member functions, except that all the numbers and names are known
+ * constants. Used to store expected values of NURBS objects.
+ */
 class NurbsObject {
  private:
   std::string nurbs_name_;
-  std::vector<std::vector<arr_float_3>> coordinates_;
+  std::vector<std::vector<array_float_3>> coordinates_;
 
  public:
   NurbsObject(const std::string nurbs_name,
-              const std::vector<std::vector<arr_float_3>> coordinates)
+              const std::vector<std::vector<array_float_3>> coordinates)
       : nurbs_name_(nurbs_name), coordinates_(coordinates)
   {
   }
@@ -77,12 +83,12 @@ struct OBJExportParamsDefault {
   }
 };
 
-const std::vector<std::vector<arr_float_3>> coordinates_NurbsCurve{
+const std::vector<std::vector<array_float_3>> coordinates_NurbsCurve{
     {{9.947419, 0.000000, 0.000000},
      {9.447419, 0.000000, 1.000000},
      {7.447419, 0.000000, 1.000000},
      {6.947419, 0.000000, 0.000000}}};
-const std::vector<std::vector<arr_float_3>> coordinates_NurbsCircle{
+const std::vector<std::vector<array_float_3>> coordinates_NurbsCircle{
     {{11.463165, 0.000000, -1.000000},
      {12.463165, 0.000000, -1.000000},
      {12.463165, 0.000000, 0.000000},
@@ -91,7 +97,7 @@ const std::vector<std::vector<arr_float_3>> coordinates_NurbsCircle{
      {10.463165, 0.000000, 1.000000},
      {10.463165, 0.000000, 0.000000},
      {10.463165, 0.000000, -1.000000}}};
-const std::vector<std::vector<arr_float_3>> coordinates_NurbsPath{
+const std::vector<std::vector<array_float_3>> coordinates_NurbsPath{
     {{17.690557, 0.000000, 0.000000},
      {16.690557, 0.000000, 0.000000},
      {15.690557, 0.000000, 0.000000},



More information about the Bf-blender-cvs mailing list