diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc | 28 | ||||
-rw-r--r-- | source/blender/io/wavefront_obj/tests/obj_importer_tests.cc | 8 |
2 files changed, 14 insertions, 22 deletions
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 99e9543a461..61699c78ace 100644 --- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc +++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc @@ -273,34 +273,26 @@ parm 0.0 /* Return true if string #a and string #b are equal after their first newline. */ static bool strings_equal_after_first_lines(const std::string &a, const std::string &b) { - /* If `dbg_level` is true then a failing test will print context around the first mismatch. */ - const bool dbg_level = false; const size_t a_len = a.size(); const size_t b_len = b.size(); const size_t a_next = a.find_first_of('\n'); const size_t b_next = b.find_first_of('\n'); if (a_next == std::string::npos || b_next == std::string::npos) { - if (dbg_level) { - std::cout << "Couldn't find newline in one of args\n"; - } + std::cout << "Couldn't find newline in one of args\n"; return false; } - if (dbg_level) { - if (a.compare(a_next, a_len - a_next, b, b_next, b_len - b_next) != 0) { - for (int i = 0; i < a_len - a_next && i < b_len - b_next; ++i) { - if (a[a_next + i] != b[b_next + i]) { - std::cout << "Difference found at pos " << a_next + i << " of a\n"; - std::cout << "a: " << a.substr(a_next + i, 100) << " ...\n"; - std::cout << "b: " << b.substr(b_next + i, 100) << " ... \n"; - return false; - } + if (a.compare(a_next, a_len - a_next, b, b_next, b_len - b_next) != 0) { + for (int i = 0; i < a_len - a_next && i < b_len - b_next; ++i) { + if (a[a_next + i] != b[b_next + i]) { + std::cout << "Difference found at pos " << a_next + i << " of a\n"; + std::cout << "a: " << a.substr(a_next + i, 100) << " ...\n"; + std::cout << "b: " << b.substr(b_next + i, 100) << " ... \n"; + return false; } } - else { - return true; - } + return false; } - return a.compare(a_next, a_len - a_next, b, b_next, b_len - b_next) == 0; + return true; } /* From here on, tests are whole file tests, testing for golden output. */ diff --git a/source/blender/io/wavefront_obj/tests/obj_importer_tests.cc b/source/blender/io/wavefront_obj/tests/obj_importer_tests.cc index 0a70a03dc65..9dd9e7c1a37 100644 --- a/source/blender/io/wavefront_obj/tests/obj_importer_tests.cc +++ b/source/blender/io/wavefront_obj/tests/obj_importer_tests.cc @@ -387,15 +387,15 @@ TEST_F(obj_importer_test, import_all_objects) float3(28, 1, -1), float3(26, 1, 1), float3(-1, 0, 0)}, - {"OBSubSurfCube", + {"OBTaperCube", OB_MESH, 106, 208, 104, 416, - float3(24.444445f, 0.444444f, -0.666667f), - float3(23.790743f, 0.490725f, -0.816819f), - float3(0.1697f, 0.1697f, 0.9708f)}, + float3(24.444445f, 0.502543f, -0.753814f), + float3(23.790743f, 0.460522f, -0.766546f), + float3(-0.0546f, 0.1716f, 0.9837f)}, {"OBParticleCube", OB_MESH, 8, |