Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik authored and prgeor committed Oct 23, 2024
1 parent 362ab17 commit 838a3ce
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions syncd/NotificationHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ void NotificationHandler::setApiVersion(
m_apiVersion = apiVersion;
}

sai_api_version_t NotificationHandler::getApiVersion() const
{
SWSS_LOG_ENTER();

return m_apiVersion;
}

void NotificationHandler::setSwitchNotifications(
_In_ const sai_switch_notifications_t& switchNotifications)
{
Expand Down
2 changes: 2 additions & 0 deletions syncd/NotificationHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ namespace syncd
void setApiVersion(
_In_ sai_api_version_t apiVersion);

sai_api_version_t getApiVersion() const;

public: // members reflecting SAI callbacks

void onFdbEvent(
Expand Down
4 changes: 4 additions & 0 deletions unittest/syncd/TestNotificationHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,9 @@ TEST(NotificationHandler, setApiVersion)

auto nh = std::make_shared<NotificationHandler>(np);

EXPECT_EQ(SAI_VERSION(0,0,0), nh->getApiVersion());

nh->setApiVersion(SAI_VERSION(1,15,0));

EXPECT_EQ(SAI_VERSION(1,15,0), nh->getApiVersion());
}

0 comments on commit 838a3ce

Please sign in to comment.