From dfcba645f586458067c8c8debb4f66560b09718f Mon Sep 17 00:00:00 2001 From: Vivek Reddy Karri Date: Fri, 20 May 2022 23:21:18 +0000 Subject: [PATCH] Restored original del func on mock_table Signed-off-by: Vivek Reddy Karri --- tests/mock_tests/mock_table.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/mock_tests/mock_table.cpp b/tests/mock_tests/mock_table.cpp index fb98ed301b..4d512a9835 100644 --- a/tests/mock_tests/mock_table.cpp +++ b/tests/mock_tests/mock_table.cpp @@ -64,12 +64,6 @@ namespace swss table[key] = values; } - void Table::del(const std::string &key, const std::string& /* op */, const std::string& /*prefix*/) - { - auto &table = gDB[m_pipe->getDbId()][getTableName()]; - table.erase(key); - } - void Table::getKeys(std::vector &keys) { keys.clear(); @@ -80,6 +74,14 @@ namespace swss } } + void Table::del(const std::string &key, const std::string& /* op */, const std::string& /*prefix*/) + { + auto table = gDB[m_pipe->getDbId()].find(getTableName()); + if (table != gDB[m_pipe->getDbId()].end()){ + table->second.erase(key); + } + } + void ProducerStateTable::set(const std::string &key, const std::vector &values, const std::string &op,