[Bf-blender-cvs] [7df435325b5] master: Fix implicit cast from bool to int in path tests
Sergey Sharybin
noreply at git.blender.org
Mon Mar 16 10:55:26 CET 2020
Commit: 7df435325b5a4b8b34d61db42094554279e6bd62
Author: Sergey Sharybin
Date: Mon Mar 16 10:53:22 2020 +0100
Branches: master
https://developer.blender.org/rB7df435325b5a4b8b34d61db42094554279e6bd62
Fix implicit cast from bool to int in path tests
===================================================================
M tests/gtests/blenlib/BLI_path_util_test.cc
===================================================================
diff --git a/tests/gtests/blenlib/BLI_path_util_test.cc b/tests/gtests/blenlib/BLI_path_util_test.cc
index 2b47995095a..401ba2d5ffb 100644
--- a/tests/gtests/blenlib/BLI_path_util_test.cc
+++ b/tests/gtests/blenlib/BLI_path_util_test.cc
@@ -123,10 +123,10 @@ TEST(path_util, Clean)
int index_output, len_output; \
const bool ret = BLI_path_name_at_index(path, index_input, &index_output, &len_output); \
if (expect == NULL) { \
- EXPECT_EQ(ret, false); \
+ EXPECT_FALSE(ret); \
} \
else { \
- EXPECT_EQ(ret, true); \
+ EXPECT_TRUE(ret); \
EXPECT_EQ(strlen(expect), len_output); \
path[index_output + len_output] = '\0'; \
EXPECT_STREQ(&path[index_output], expect); \
@@ -355,42 +355,42 @@ TEST(path_util, Frame)
{
char path[FILE_MAX] = "";
ret = BLI_path_frame(path, 123, 1);
- EXPECT_EQ(ret, 1);
+ EXPECT_TRUE(ret);
EXPECT_STREQ("123", path);
}
{
char path[FILE_MAX] = "";
ret = BLI_path_frame(path, 123, 12);
- EXPECT_EQ(ret, 1);
+ EXPECT_TRUE(ret);
EXPECT_STREQ("000000000123", path);
}
{
char path[FILE_MAX] = "test_";
ret = BLI_path_frame(path, 123, 1);
- EXPECT_EQ(ret, 1);
+ EXPECT_TRUE(ret);
EXPECT_STREQ("test_123", path);
}
{
char path[FILE_MAX] = "test_";
ret = BLI_path_frame(path, 1, 12);
- EXPECT_EQ(ret, 1);
+ EXPECT_TRUE(ret);
EXPECT_STREQ("test_000000000001", path);
}
{
char path[FILE_MAX] = "test_############";
ret = BLI_path_frame(path, 1, 0);
- EXPECT_EQ(ret, 1);
+ EXPECT_TRUE(ret);
EXPECT_STREQ("test_000000000001", path);
}
{
char path[FILE_MAX] = "test_#_#_middle";
ret = BLI_path_frame(path, 123, 0);
- EXPECT_EQ(ret, 1);
+ EXPECT_TRUE(ret);
EXPECT_STREQ("test_#_123_middle", path);
}
@@ -398,14 +398,14 @@ TEST(path_util, Frame)
{
char path[FILE_MAX] = "";
ret = BLI_path_frame(path, 123, 0);
- EXPECT_EQ(ret, 0);
+ EXPECT_FALSE(ret);
EXPECT_STREQ("", path);
}
{
char path[FILE_MAX] = "test_middle";
ret = BLI_path_frame(path, 123, 0);
- EXPECT_EQ(ret, 0);
+ EXPECT_FALSE(ret);
EXPECT_STREQ("test_middle", path);
}
}
More information about the Bf-blender-cvs
mailing list