From 6ff277841ebd6045be87d8407c840df9bc35709c Mon Sep 17 00:00:00 2001 From: whd <7058128+superwhd@users.noreply.github.com> Date: Fri, 20 Oct 2023 02:07:53 +0800 Subject: [PATCH] [tests] fix verification in `test_routing_manager.cpp` (#9548) Some equation checks accidentally became non-zero checks due to typo. Such tests may fail in certain build configurations when the heap allocation is zero after initialization of the test. --- tests/unit/test_routing_manager.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/unit/test_routing_manager.cpp b/tests/unit/test_routing_manager.cpp index c5cbb5cdad6..decb1b8bb0b 100644 --- a/tests/unit/test_routing_manager.cpp +++ b/tests/unit/test_routing_manager.cpp @@ -1309,7 +1309,7 @@ void TestOmrSelection(void) //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SuccessOrQuit(sInstance->Get().SetEnabled(false)); - VerifyOrQuit(heapAllocations = sHeapAllocatedPtrs.GetLength()); + VerifyOrQuit(heapAllocations == sHeapAllocatedPtrs.GetLength()); Log("End of TestOmrSelection"); FinalizeTest(); @@ -1474,7 +1474,7 @@ void TestDefaultRoute(void) //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SuccessOrQuit(sInstance->Get().SetEnabled(false)); - VerifyOrQuit(heapAllocations = sHeapAllocatedPtrs.GetLength()); + VerifyOrQuit(heapAllocations == sHeapAllocatedPtrs.GetLength()); Log("End of TestDefaultRoute"); @@ -1640,7 +1640,7 @@ void TestAdvNonUlaRoute(void) //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SuccessOrQuit(sInstance->Get().SetEnabled(false)); - VerifyOrQuit(heapAllocations = sHeapAllocatedPtrs.GetLength()); + VerifyOrQuit(heapAllocations == sHeapAllocatedPtrs.GetLength()); Log("End of TestAdvNonUlaRoute"); @@ -1779,7 +1779,7 @@ void TestLocalOnLinkPrefixDeprecation(void) //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SuccessOrQuit(sInstance->Get().SetEnabled(false)); - VerifyOrQuit(heapAllocations = sHeapAllocatedPtrs.GetLength()); + VerifyOrQuit(heapAllocations == sHeapAllocatedPtrs.GetLength()); Log("End of TestLocalOnLinkPrefixDeprecation"); @@ -1931,7 +1931,7 @@ void TestDomainPrefixAsOmr(void) //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SuccessOrQuit(sInstance->Get().SetEnabled(false)); - VerifyOrQuit(heapAllocations = sHeapAllocatedPtrs.GetLength()); + VerifyOrQuit(heapAllocations == sHeapAllocatedPtrs.GetLength()); Log("End of TestDomainPrefixAsOmr"); FinalizeTest(); @@ -2440,7 +2440,7 @@ void TestExtPanIdChange(void) //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SuccessOrQuit(sInstance->Get().SetEnabled(false)); - VerifyOrQuit(heapAllocations = sHeapAllocatedPtrs.GetLength()); + VerifyOrQuit(heapAllocations == sHeapAllocatedPtrs.GetLength()); Log("End of TestExtPanIdChange"); FinalizeTest(); @@ -2593,7 +2593,7 @@ void TestRouterNsProbe(void) //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SuccessOrQuit(sInstance->Get().SetEnabled(false)); - VerifyOrQuit(heapAllocations = sHeapAllocatedPtrs.GetLength()); + VerifyOrQuit(heapAllocations == sHeapAllocatedPtrs.GetLength()); Log("End of TestRouterNsProbe"); FinalizeTest(); @@ -2812,7 +2812,7 @@ void TestConflictingPrefix(void) //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SuccessOrQuit(sInstance->Get().SetEnabled(false)); - VerifyOrQuit(heapAllocations = sHeapAllocatedPtrs.GetLength()); + VerifyOrQuit(heapAllocations == sHeapAllocatedPtrs.GetLength()); Log("End of TestConflictingPrefix");