From 43141324a40a62375b10cdf0fa0d57558d3cc06a Mon Sep 17 00:00:00 2001 From: v0-e Date: Mon, 29 Jan 2024 14:26:06 +0000 Subject: [PATCH] asn1: Prefer value over boolean checks in asn1c wrapper compare() tests --- vanetza/asn1/tests/asn1c_wrapper.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/vanetza/asn1/tests/asn1c_wrapper.cpp b/vanetza/asn1/tests/asn1c_wrapper.cpp index b25677c39..24a7c3309 100644 --- a/vanetza/asn1/tests/asn1c_wrapper.cpp +++ b/vanetza/asn1/tests/asn1c_wrapper.cpp @@ -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);