Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2022-01-12 14:36:47 +0300
committerJeroen Bakker <jeroen@blender.org>2022-01-12 15:02:28 +0300
commit08820690953db8e28586fb2446a41d5160c70750 (patch)
treef25a7480dea0a662c6867d2c35bb0bd2de9886c5
parent1552b86b55c04bfab77666b423b60461d9a18166 (diff)
Cleanup: codestyle obj_exporter_tests.cc.
-rw-r--r--source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc12
1 files 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);