Skip to content

Commit

Permalink
Macro argument should be enclosed in parentheses
Browse files Browse the repository at this point in the history
  • Loading branch information
relaxcn committed Dec 15, 2021
1 parent 65c078b commit 0c79e51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tutorial03/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static int test_pass = 0;
#define EXPECT_EQ_INT(expect, actual) EXPECT_EQ_BASE((expect) == (actual), expect, actual, "%d")
#define EXPECT_EQ_DOUBLE(expect, actual) EXPECT_EQ_BASE((expect) == (actual), expect, actual, "%.17g")
#define EXPECT_EQ_STRING(expect, actual, alength) \
EXPECT_EQ_BASE(sizeof(expect) - 1 == alength && memcmp(expect, actual, alength) == 0, expect, actual, "%s")
EXPECT_EQ_BASE(sizeof(expect) - 1 == (alength) && memcmp(expect, actual, alength) == 0, expect, actual, "%s")
#define EXPECT_TRUE(actual) EXPECT_EQ_BASE((actual) != 0, "true", "false", "%s")
#define EXPECT_FALSE(actual) EXPECT_EQ_BASE((actual) == 0, "false", "true", "%s")

Expand Down

0 comments on commit 0c79e51

Please sign in to comment.