Skip to content

Commit

Permalink
Update UT to include ASAN changes
Browse files Browse the repository at this point in the history
Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
  • Loading branch information
vivekrnv committed May 20, 2022
1 parent 0523b8c commit 8a3c138
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 0 additions & 7 deletions portsyncd/linksync.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,4 @@ class LinkSync : public NetMsg
void handlePortConfigFromConfigDB(swss::ProducerStateTable &, swss::DBConnector &, bool );
void handlePortConfig(swss::ProducerStateTable &, std::map<std::string, swss::KeyOpFieldsValuesTuple> &);

struct if_nameindex
{
unsigned int if_index;
char *if_name;
};
extern "C" { extern struct if_nameindex *if_nameindex (void) __THROW; }

#endif
10 changes: 9 additions & 1 deletion tests/mock_tests/portsyncd/portsyncd_ut.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "gtest/gtest.h"
#include <linux/if.h>
#include <net/if.h>
#include <netlink/route/link.h>
#include "../mock_table.h"
#define private public
Expand All @@ -16,6 +16,14 @@ extern "C" {
}
}

/* Mock if_freenameindex() call */
extern "C" {
void __wrap_if_freenameindex(struct if_nameindex *ptr)
{
return ;
}
}

extern std::string mockCmdStdcout;
extern std::vector<std::string> mockCallArgs;
extern std::set<std::string> g_portSet;
Expand Down

0 comments on commit 8a3c138

Please sign in to comment.