From 08820690953db8e28586fb2446a41d5160c70750 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Wed, 12 Jan 2022 12:36:47 +0100 Subject: Cleanup: codestyle obj_exporter_tests.cc. --- source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 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 f9151bb97f8..e7db1c36203 100644 --- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc +++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc @@ -197,7 +197,7 @@ static std::string read_temp_file_in_string(const std::string &file_path) TEST(obj_exporter_writer, header) { /* Because testing doesn't fully initialize Blender, we need the following. */ - BKE_tempdir_init(NULL); + BKE_tempdir_init(nullptr); std::string out_file_path = blender::tests::flags_test_release_dir() + "/" + temp_file_path; { OBJExportParamsDefault _export; @@ -235,19 +235,19 @@ TEST(obj_exporter_writer, mtllib) /* 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 > 0` then a failing test will print context around the first mismatch. */ - const int dbg_level = 0; + /* 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 > 0) { + if (dbg_level) { std::cout << "Couldn't find newline in one of args\n"; } return false; } - if (dbg_level > 0) { + 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]) { @@ -284,7 +284,7 @@ class obj_exporter_regression_test : public obj_exporter_test { return; } /* Because testing doesn't fully initialize Blender, we need the following. */ - BKE_tempdir_init(NULL); + BKE_tempdir_init(nullptr); 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 - 1); -- cgit v1.2.3