-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit test for trap flow flex counter
- Loading branch information
1 parent
6e5cf82
commit 5b77bf7
Showing
8 changed files
with
489 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
AM_CXXFLAGS = $(SAIINC) -I$(top_srcdir)/syncd -I$(top_srcdir)/lib -I$(top_srcdir)/vslib | ||
AM_CXXFLAGS = $(SAIINC) -I$(top_srcdir)/syncd -I$(top_srcdir)/lib -I$(top_srcdir)/vslib -I$(top_srcdir)/meta | ||
|
||
bin_PROGRAMS = tests | ||
|
||
LDADD_GTEST = -L/usr/src/gtest -lgtest -lgtest_main | ||
|
||
tests_SOURCES = main.cpp \ | ||
TestCommandLineOptions.cpp | ||
../../meta/DummySaiInterface.cpp \ | ||
MockHelper.cpp \ | ||
TestCommandLineOptions.cpp \ | ||
TestFlexCounter.cpp | ||
|
||
tests_CXXFLAGS = $(DBGFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS_COMMON) | ||
tests_LDADD = $(LDADD_GTEST) $(top_srcdir)/syncd/libSyncd.a -lswsscommon -lpthread -L$(top_srcdir)/lib/.libs -lsairedis -L$(top_srcdir)/meta/.libs -lsaimetadata -lsaimeta -lzmq $(CODE_COVERAGE_LIBS) | ||
tests_LDADD = $(LDADD_GTEST) $(top_srcdir)/syncd/libSyncd.a -lhiredis -lswsscommon -lpthread -L$(top_srcdir)/lib/.libs -lsairedis -L$(top_srcdir)/meta/.libs -lsaimetadata -lsaimeta -lzmq $(CODE_COVERAGE_LIBS) | ||
|
||
TESTS = tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include "VidManager.h" | ||
#include "swss/dbconnector.h" | ||
#include "swss/table.h" | ||
|
||
namespace test_syncd { | ||
sai_object_type_t mock_objectTypeQuery_result; | ||
void mockVidManagerObjectTypeQuery(sai_object_type_t mock_result) | ||
{ | ||
mock_objectTypeQuery_result = mock_result; | ||
} | ||
} | ||
|
||
namespace syncd { | ||
sai_object_type_t VidManager::objectTypeQuery(_In_ sai_object_id_t objectId) | ||
{ | ||
return test_syncd::mock_objectTypeQuery_result; | ||
} | ||
} | ||
|
||
/* | ||
namespace swss { | ||
DBConnector::DBConnector(const std::string& dbName, unsigned int timeout, bool isTcpConn) | ||
{ | ||
} | ||
DBConnector *DBConnector::newConnector(unsigned int timeout) const | ||
{ | ||
return nullptr; | ||
} | ||
Table::Table(RedisPipeline *pipeline, const std::string &tableName, bool buffered) | ||
{ | ||
} | ||
}*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#pragma once | ||
|
||
namespace test_syncd { | ||
void mockVidManagerObjectTypeQuery(sai_object_type_t); | ||
} |
Oops, something went wrong.