From 12517120d54ee4d72ffbf3be70278733e4f0e1b4 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 23 Sep 2021 21:06:13 -0400 Subject: [PATCH] Fix TLV test to produce more useful failure output. (#9934) Assertions inside the Get<> function are hard to trace back to the actual Get<> caller, because they just list the line number of the Get<> function. Replace it with a macro, so we get more useful output on failure. Co-authored-by: Boris Itkis --- src/lib/core/tests/TestCHIPTLV.cpp | 180 +++++++++++++++-------------- 1 file changed, 93 insertions(+), 87 deletions(-) diff --git a/src/lib/core/tests/TestCHIPTLV.cpp b/src/lib/core/tests/TestCHIPTLV.cpp index 6c3dadf36e2fc2..3d61ddc0bff7a9 100644 --- a/src/lib/core/tests/TestCHIPTLV.cpp +++ b/src/lib/core/tests/TestCHIPTLV.cpp @@ -140,19 +140,23 @@ void TestEndAndExitContainer(nlTestSuite * inSuite, T & t, TLVType outerContaine NL_TEST_ASSERT(inSuite, t.GetContainerType() == outerContainerType); } -template -void TestGet(nlTestSuite * inSuite, S & s, TLVType type, uint64_t tag, T expectedVal) -{ - NL_TEST_ASSERT(inSuite, s.GetType() == type); - NL_TEST_ASSERT(inSuite, s.GetTag() == tag); - NL_TEST_ASSERT(inSuite, s.GetLength() == 0); - - T val; - CHIP_ERROR err = s.Get(val); - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - - NL_TEST_ASSERT(inSuite, val == expectedVal); -} +#define TEST_GET(inSuite, s, type, tag, expectedVal, expectedErr) \ + do \ + { \ + NL_TEST_ASSERT(inSuite, s.GetType() == type); \ + NL_TEST_ASSERT(inSuite, s.GetTag() == tag); \ + NL_TEST_ASSERT(inSuite, s.GetLength() == 0); \ + \ + decltype(expectedVal) __val; \ + CHIP_ERROR __err = s.Get(__val); \ + NL_TEST_ASSERT(inSuite, __err == expectedErr); \ + if (__err == CHIP_NO_ERROR) \ + { \ + NL_TEST_ASSERT(inSuite, __val == expectedVal); \ + } \ + } while (false) + +#define TEST_GET_NOERROR(inSuite, s, type, tag, expectedVal) TEST_GET(inSuite, s, type, tag, expectedVal, CHIP_NO_ERROR) void ForEachElement(nlTestSuite * inSuite, TLVReader & reader, void * context, void (*cb)(nlTestSuite * inSuite, TLVReader & reader, void * context)) @@ -486,11 +490,11 @@ void ReadEncoding1(nlTestSuite * inSuite, TLVReader & reader) TestNext(inSuite, reader2); - TestGet(inSuite, reader2, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); + TEST_GET_NOERROR(inSuite, reader2, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); TestNext(inSuite, reader2); - TestGet(inSuite, reader2, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); + TEST_GET_NOERROR(inSuite, reader2, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); TestNext(inSuite, reader2); @@ -501,31 +505,31 @@ void ReadEncoding1(nlTestSuite * inSuite, TLVReader & reader) TestNext(inSuite, reader3); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, 42); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, 42); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, 42); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, 42); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, 42); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, 42); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, 42); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, 42); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); TestNext(inSuite, reader3); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, -17); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, -17); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, -17); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, -17); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-17)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-17)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-17)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-17)); TestNext(inSuite, reader3); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, -170000); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, -170000); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-170000)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-170000)); TestNext(inSuite, reader3); - TestGet(inSuite, reader3, kTLVType_UnsignedInteger, AnonymousTag, 40000000000ULL); - TestGet(inSuite, reader3, kTLVType_UnsignedInteger, AnonymousTag, 40000000000ULL); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_UnsignedInteger, AnonymousTag, static_cast(40000000000ULL)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_UnsignedInteger, AnonymousTag, static_cast(40000000000ULL)); TestNext(inSuite, reader3); @@ -583,12 +587,13 @@ void ReadEncoding1(nlTestSuite * inSuite, TLVReader & reader) TestNext(inSuite, reader2); - TestGet(inSuite, reader2, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_2, 65535), 17.9f); - TestGet(inSuite, reader2, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_2, 65535), 17.9f); + TEST_GET_NOERROR(inSuite, reader2, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_2, 65535), 17.9f); + TEST_GET_NOERROR(inSuite, reader2, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_2, 65535), + static_cast(17.9f)); TestNext(inSuite, reader2); - TestGet(inSuite, reader2, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_2, 65536), 17.9); + TEST_GET_NOERROR(inSuite, reader2, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_2, 65536), 17.9); TestEndAndCloseContainer(inSuite, reader, reader2); } @@ -666,7 +671,7 @@ void ReadEncoding3(nlTestSuite * inSuite, TLVReader & reader) TestNext(inSuite, reader2); - TestGet(inSuite, reader2, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); + TEST_GET_NOERROR(inSuite, reader2, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); TestEndAndCloseContainer(inSuite, reader, reader2); } @@ -815,7 +820,7 @@ void AppendEncoding2(nlTestSuite * inSuite, uint8_t * buf, uint32_t dataLen, uin TestNext(inSuite, updater); // Read and copy the element with/without modification - TestGet(inSuite, updater, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); + TEST_GET_NOERROR(inSuite, updater, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); err = updater.PutBoolean(ProfileTag(TestProfile_2, 2), false); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); @@ -1125,7 +1130,7 @@ void DeleteEncoding5(nlTestSuite * inSuite, uint8_t * buf, uint32_t dataLen, uin TestNext(inSuite, updater); // Get the value to inspect and skip writing it - TestGet(inSuite, updater, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), false); + TEST_GET_NOERROR(inSuite, updater, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), false); TestNext(inSuite, updater); @@ -1180,19 +1185,19 @@ void ReadAppendedEncoding2(nlTestSuite * inSuite, TLVReader & reader) TestNext(inSuite, reader1); - TestGet(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); + TEST_GET_NOERROR(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); TestNext(inSuite, reader1); - TestGet(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); + TEST_GET_NOERROR(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); TestNext(inSuite, reader1); - TestGet(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), false); + TEST_GET_NOERROR(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), false); TestNext(inSuite, reader1); - TestGet(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), true); + TEST_GET_NOERROR(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), true); TestNext(inSuite, reader1); @@ -1203,11 +1208,11 @@ void ReadAppendedEncoding2(nlTestSuite * inSuite, TLVReader & reader) TestNext(inSuite, reader2); - TestGet(inSuite, reader2, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); + TEST_GET_NOERROR(inSuite, reader2, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); TestNext(inSuite, reader2); - TestGet(inSuite, reader2, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); + TEST_GET_NOERROR(inSuite, reader2, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); TestEndAndCloseContainer(inSuite, reader1, reader2); } @@ -1221,11 +1226,11 @@ void ReadAppendedEncoding2(nlTestSuite * inSuite, TLVReader & reader) TestNext(inSuite, reader2); - TestGet(inSuite, reader2, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); + TEST_GET_NOERROR(inSuite, reader2, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); TestNext(inSuite, reader2); - TestGet(inSuite, reader2, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); + TEST_GET_NOERROR(inSuite, reader2, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); TestEndAndCloseContainer(inSuite, reader1, reader2); } @@ -1242,11 +1247,11 @@ void ReadAppendedEncoding2(nlTestSuite * inSuite, TLVReader & reader) TestNext(inSuite, reader1); - TestGet(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); + TEST_GET_NOERROR(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); TestNext(inSuite, reader1); - TestGet(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); + TEST_GET_NOERROR(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); TestEndAndCloseContainer(inSuite, reader, reader1); } @@ -1265,11 +1270,11 @@ void ReadAppendedEncoding3(nlTestSuite * inSuite, TLVReader & reader) TestNext(inSuite, reader1); - TestGet(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); + TEST_GET_NOERROR(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); TestNext(inSuite, reader1); - TestGet(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), true); + TEST_GET_NOERROR(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), true); TestEndAndCloseContainer(inSuite, reader, reader1); } @@ -1288,7 +1293,7 @@ void ReadAppendedEncoding4(nlTestSuite * inSuite, TLVReader & reader) TestNext(inSuite, reader1); - TestGet(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); + TEST_GET_NOERROR(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); TestEndAndCloseContainer(inSuite, reader, reader1); } @@ -1307,11 +1312,11 @@ void ReadDeletedEncoding5(nlTestSuite * inSuite, TLVReader & reader) TestNext(inSuite, reader1); - TestGet(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); + TEST_GET_NOERROR(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); TestNext(inSuite, reader1); - TestGet(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); + TEST_GET_NOERROR(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); TestEndAndCloseContainer(inSuite, reader, reader1); } @@ -1325,11 +1330,11 @@ void ReadDeletedEncoding5(nlTestSuite * inSuite, TLVReader & reader) TestNext(inSuite, reader1); - TestGet(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); + TEST_GET_NOERROR(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); TestNext(inSuite, reader1); - TestGet(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); + TEST_GET_NOERROR(inSuite, reader1, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); TestEndAndCloseContainer(inSuite, reader, reader1); } @@ -2190,7 +2195,7 @@ void CheckCircularTLVBufferEdge(nlTestSuite * inSuite, void * inContext) reader.ImplicitProfileId = TestProfile_2; TestNext(inSuite, reader); - TestGet(inSuite, reader, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), false); + TEST_GET_NOERROR(inSuite, reader, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), false); // Check that the reader is out of data TestEnd(inSuite, reader); @@ -2223,7 +2228,7 @@ void CheckCircularTLVBufferEdge(nlTestSuite * inSuite, void * inContext) reader.ImplicitProfileId = TestProfile_2; TestNext(inSuite, reader); - TestGet(inSuite, reader, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); + TEST_GET_NOERROR(inSuite, reader, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); TestEnd(inSuite, reader); buffer1.EvictHead(); @@ -2256,10 +2261,10 @@ void CheckCircularTLVBufferEdge(nlTestSuite * inSuite, void * inContext) reader.ImplicitProfileId = TestProfile_2; TestNext(inSuite, reader); - TestGet(inSuite, reader, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); + TEST_GET_NOERROR(inSuite, reader, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); TestNext(inSuite, reader); - TestGet(inSuite, reader, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), false); + TEST_GET_NOERROR(inSuite, reader, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), false); TestEnd(inSuite, reader); @@ -2272,7 +2277,7 @@ void CheckCircularTLVBufferEdge(nlTestSuite * inSuite, void * inContext) reader.ImplicitProfileId = TestProfile_2; TestNext(inSuite, reader); - TestGet(inSuite, reader, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), false); + TEST_GET_NOERROR(inSuite, reader, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), false); // Check that the reader is out of data TestEnd(inSuite, reader); @@ -2293,10 +2298,10 @@ void CheckCircularTLVBufferEdge(nlTestSuite * inSuite, void * inContext) reader.ImplicitProfileId = TestProfile_2; TestNext(inSuite, reader); - TestGet(inSuite, reader, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), false); + TEST_GET_NOERROR(inSuite, reader, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), false); TestNext(inSuite, reader); - TestGet(inSuite, reader, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); + TEST_GET_NOERROR(inSuite, reader, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); TestEnd(inSuite, reader); @@ -2957,11 +2962,11 @@ void TestCHIPTLVReaderDup(nlTestSuite * inSuite) TestNext(inSuite, reader2); - TestGet(inSuite, reader2, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); + TEST_GET_NOERROR(inSuite, reader2, kTLVType_Boolean, ProfileTag(TestProfile_1, 2), true); TestNext(inSuite, reader2); - TestGet(inSuite, reader2, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); + TEST_GET_NOERROR(inSuite, reader2, kTLVType_Boolean, ProfileTag(TestProfile_2, 2), false); TestNext(inSuite, reader2); @@ -2972,29 +2977,29 @@ void TestCHIPTLVReaderDup(nlTestSuite * inSuite) TestNext(inSuite, reader3); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, 42); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, 42); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, 42); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, 42); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, 42); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, 42); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); TestNext(inSuite, reader3); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, -17); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, -17); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, -17); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, -17); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-17)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-17)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-17)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-17)); TestNext(inSuite, reader3); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, -170000); - TestGet(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, -170000); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-170000)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-170000)); TestNext(inSuite, reader3); - TestGet(inSuite, reader3, kTLVType_UnsignedInteger, AnonymousTag, 40000000000ULL); - TestGet(inSuite, reader3, kTLVType_UnsignedInteger, AnonymousTag, 40000000000ULL); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_UnsignedInteger, AnonymousTag, static_cast(40000000000ULL)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_UnsignedInteger, AnonymousTag, static_cast(40000000000ULL)); TestNext(inSuite, reader3); @@ -3052,12 +3057,13 @@ void TestCHIPTLVReaderDup(nlTestSuite * inSuite) TestNext(inSuite, reader2); - TestGet(inSuite, reader2, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_2, 65535), 17.9f); - TestGet(inSuite, reader2, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_2, 65535), 17.9f); + TEST_GET_NOERROR(inSuite, reader2, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_2, 65535), 17.9f); + TEST_GET_NOERROR(inSuite, reader2, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_2, 65535), + static_cast(17.9f)); TestNext(inSuite, reader2); - TestGet(inSuite, reader2, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_2, 65536), 17.9); + TEST_GET_NOERROR(inSuite, reader2, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_2, 65536), 17.9); TestEndAndCloseContainer(inSuite, reader, reader2); } @@ -3158,7 +3164,7 @@ void TestCHIPTLVReaderTruncatedReads(nlTestSuite * inSuite) TestNext(inSuite, reader); - TestGet(inSuite, reader, kTLVType_FloatingPointNumber, AnonymousTag, 12.5); + TEST_GET_NOERROR(inSuite, reader, kTLVType_FloatingPointNumber, AnonymousTag, 12.5); err = reader.Get(outF); NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_WRONG_TLV_TYPE); @@ -3182,18 +3188,18 @@ void TestCHIPTLVReaderInPractice(nlTestSuite * inSuite) TestNext(inSuite, reader); - TestGet(inSuite, reader, kTLVType_SignedInteger, ProfileTag(TestProfile_1, 4000000000ULL), - static_cast(40000000000ULL)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, ProfileTag(TestProfile_1, 4000000000ULL), + static_cast(40000000000ULL)); TestNext(inSuite, reader); - TestGet(inSuite, reader, kTLVType_SignedInteger, ProfileTag(TestProfile_1, 4000000000ULL), - static_cast(12345)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, ProfileTag(TestProfile_1, 4000000000ULL), + static_cast(12345)); TestNext(inSuite, reader); - TestGet(inSuite, reader, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_1, 4000000000ULL), - static_cast(1.0)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_1, 4000000000ULL), + static_cast(1.0)); } void TestCHIPTLVReader_NextOverContainer_ProcessElement(nlTestSuite * inSuite, TLVReader & reader, void * context)