The first argument of 'memcmp' function was equal to the second argument.
Therefore ASSERT would always be true.

Link: https://pvs-studio.com/en/blog/posts/cpp/1179/

Fixes: 92073ef961ee ("bond: unit tests")
Cc: declan.dohe...@intel.com
Cc: sta...@dpdk.org

Signed-off-by: Stephen Hemminger <step...@networkplumber.org>
---
 app/test/test_link_bonding.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
index 805613d7dd..b752a5ecbf 100644
--- a/app/test/test_link_bonding.c
+++ b/app/test/test_link_bonding.c
@@ -792,7 +792,7 @@ test_set_primary_member(void)
                                &read_mac_addr),
                                "Failed to get mac address (port %d)",
                                test_params->bonding_port_id);
-               TEST_ASSERT_SUCCESS(memcmp(&read_mac_addr, &read_mac_addr,
+               TEST_ASSERT_SUCCESS(memcmp(expected_mac_addr, &read_mac_addr,
                                sizeof(read_mac_addr)),
                                "bonding port mac address not set to that of 
primary port\n");
 
-- 
2.45.2

Reply via email to