Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6051688

Browse files
committedApr 22, 2024·
Use EXPECT_STREQ
1 parent 66d13bf commit 6051688

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed
 

‎src/lib/format/tests/TestDecoding.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void TestSampleData(const PayloadDecoderInitParams & params, const SamplePayload
128128
printf("ACTUAL: '%s'\n", partial.Reset().Add(output_builder.c_str() + idx).AddMarkerIfOverflow().c_str());
129129
}
130130

131-
EXPECT_EQ(strcmp(output_builder.c_str(), expectation), 0);
131+
EXPECT_STREQ(output_builder.c_str(), expectation);
132132
}
133133

134134
TEST(TestDecoding, TestFullDataDecoding)

‎src/lib/format/tests/TestFlatTree.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -83,21 +83,21 @@ class ByName
8383

8484
TEST(TestFlatTree, TestFlatTreeFind)
8585
{
86-
EXPECT_EQ(strcmp(FindEntry(tree, 0, ByTag(ContextTag(1)))->data.name, "hello"), 0);
87-
EXPECT_EQ(strcmp(FindEntry(tree, 0, ByTag(ContextTag(2)))->data.name, "world"), 0);
86+
EXPECT_STREQ(FindEntry(tree, 0, ByTag(ContextTag(1)))->data.name, "hello");
87+
EXPECT_STREQ(FindEntry(tree, 0, ByTag(ContextTag(2)))->data.name, "world");
8888
EXPECT_EQ(FindEntry(tree, 0, ByTag(ContextTag(3))), nullptr);
8989

9090
EXPECT_EQ(FindEntry(tree, 0, ByName("hello"))->data.tag, ContextTag(1));
9191
EXPECT_EQ(FindEntry(tree, 0, ByName("world"))->data.tag, ContextTag(2));
9292
EXPECT_EQ(FindEntry(tree, 0, ByName("foo")), nullptr);
9393

9494
EXPECT_EQ(FindEntry(tree, 1, ByTag(ContextTag(1))), nullptr);
95-
EXPECT_EQ(strcmp(FindEntry(tree, 1, ByTag(ProfileTag(234, 2)))->data.name, "b"), 0);
96-
EXPECT_EQ(strcmp(FindEntry(tree, 1, ByTag(ProfileTag(345, 3)))->data.name, "c"), 0);
95+
EXPECT_STREQ(FindEntry(tree, 1, ByTag(ProfileTag(234, 2)))->data.name, "b");
96+
EXPECT_STREQ(FindEntry(tree, 1, ByTag(ProfileTag(345, 3)))->data.name, "c");
9797
EXPECT_EQ(FindEntry(tree, 1, ByTag(AnonymousTag())), nullptr);
9898

9999
EXPECT_EQ(FindEntry(tree, 2, ByTag(ContextTag(1))), nullptr);
100-
EXPECT_EQ(strcmp(FindEntry(tree, 2, ByTag(AnonymousTag()))->data.name, "foo"), 0);
100+
EXPECT_STREQ(FindEntry(tree, 2, ByTag(AnonymousTag()))->data.name, "foo");
101101

102102
// out of array
103103
EXPECT_EQ(FindEntry(tree, 3, ByTag(AnonymousTag())), nullptr);

‎src/lib/format/tests/TestFlatTreePosition.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class ByName
9494

9595
#define ASSERT_HAS_NAME(p, n) \
9696
EXPECT_NE(p.Get(), nullptr); \
97-
EXPECT_EQ(strcmp(p.Get()->name, n), 0)
97+
EXPECT_STREQ(p.Get()->name, n);
9898

9999
#define ASSERT_HAS_CONTEXT_TAG(p, t) \
100100
EXPECT_NE(p.Get(), nullptr); \

0 commit comments

Comments
 (0)
Please sign in to comment.