Skip to content

Commit

Permalink
asn1: Prefer value over boolean checks in asn1c wrapper compare() tests
Browse files Browse the repository at this point in the history
  • Loading branch information
v0-e committed Jan 29, 2024
1 parent 48f6488 commit 4314132
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions vanetza/asn1/tests/asn1c_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,10 @@ TEST(asn1c_wrapper, compare) {
OCTET_STRING_fromString(&wrapper4->string, "1234");

// .compare()
EXPECT_TRUE(!wrapper1.compare(wrapper1));
EXPECT_TRUE(!wrapper1.compare(wrapper2));
EXPECT_FALSE(!wrapper1.compare(wrapper3));
EXPECT_TRUE(wrapper1.compare(wrapper3) > 0);
EXPECT_FALSE(!wrapper1.compare(wrapper4));
EXPECT_EQ(wrapper1.compare(wrapper1), 0);
EXPECT_EQ(wrapper1.compare(wrapper2), 0);
EXPECT_EQ(wrapper1.compare(wrapper3), 1);
EXPECT_EQ(wrapper1.compare(wrapper4), -1);

// operators == and !=
EXPECT_TRUE(wrapper1 == wrapper1);
Expand Down

0 comments on commit 4314132

Please sign in to comment.