From e79dbb82bee19651aeb0f546566cbab925511845 Mon Sep 17 00:00:00 2001 From: Nikola Dancejic Date: Fri, 24 May 2024 17:57:45 +0000 Subject: [PATCH] [syncd] Addressing PR comments #1373 Signed-off-by: Nikola Dancejic --- configure.ac | 5 +++++ syncd/Syncd.cpp | 3 --- syncd/tests.cpp | 8 +++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 9c6ade715..4c601e0fe 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,7 @@ AC_PROG_LIBTOOL AC_HEADER_STDC AM_PATH_PYTHON3 AX_PYTHON3_DEVEL +AX_CODE_COVERAGE AX_ADD_AM_MACRO_STATIC([]) AM_CONDITIONAL(SONIC_ASIC_PLATFORM_BAREFOOT, test x$CONFIGURED_PLATFORM = xbarefoot) @@ -28,6 +29,10 @@ AM_CONDITIONAL(DEBUG, test x$debug = xtrue) AM_COND_IF([DEBUG], AC_SUBST(DBGFLAGS, "-ggdb -DDEBUG"), AC_SUBST(DBGFLAGS, "-g")) +AM_COND_IF([DEBUG], + [AM_COND_IF([CODE_COVERAGE_ENABLED], + AC_MSG_ERROR("Flag conflict --enable-debug 'DEBUG' and --enable-code-coverage 'NDEBUG'"))]) + AC_ARG_WITH(sai, [ --with-sai=vs compiling against specific SAI], [case "${withval}" in diff --git a/syncd/Syncd.cpp b/syncd/Syncd.cpp index a732c1f72..8dd390260 100644 --- a/syncd/Syncd.cpp +++ b/syncd/Syncd.cpp @@ -1033,7 +1033,6 @@ sai_status_t Syncd::processBulkCreateEntry( attr_lists.data(), mode, statuses.data()); - } break; @@ -1339,7 +1338,6 @@ sai_status_t Syncd::processBulkRemoveEntry( entries.data(), mode, statuses.data()); - } break; @@ -1633,7 +1631,6 @@ sai_status_t Syncd::processBulkSetEntry( attr_lists.data(), mode, statuses.data()); - } break; diff --git a/syncd/tests.cpp b/syncd/tests.cpp index 526263455..9f1791d05 100644 --- a/syncd/tests.cpp +++ b/syncd/tests.cpp @@ -698,8 +698,6 @@ void test_bulk_neighbor_set() std::vector neighbors; std::vector attrs; - uint32_t index = 15; - sai_attribute_t swattr; swattr.id = SAI_SWITCH_ATTR_INIT_SWITCH; @@ -714,7 +712,7 @@ void test_bulk_neighbor_set() std::vector neighbor_attrs_array; std::vector neighbor_attrs_count; - for (uint32_t i = index; i < index + count; ++i) + for (uint32_t i = 0; i < count; ++i) { sai_neighbor_entry_t neighbor_entry; @@ -771,13 +769,13 @@ void test_bulk_neighbor_set() ASSERT_SUCCESS("Failed to create neighbor # %zu", j); } - for (uint32_t i = index; i < index + count; ++i) + for (uint32_t i = 0; i < count; ++i) { sai_attribute_t attr; attr.id = SAI_NEIGHBOR_ENTRY_ATTR_PACKET_ACTION; attr.value.s32 = SAI_PACKET_ACTION_FORWARD; - status = sai_neighbor_api->set_neighbor_entry_attribute(&neighbors[i - index], &attr); + status = sai_neighbor_api->set_neighbor_entry_attribute(&neighbors[i], &attr); attrs.push_back(attr);