Skip to content

Commit

Permalink
add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
zjswhhh committed Jan 24, 2022
1 parent b1b5926 commit bd885ee
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/LinkManagerStateMachineTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1053,4 +1053,17 @@ TEST_F(LinkManagerStateMachineTest, MuxStandbyDefaultRouteStateOK)
VALIDATE_STATE(Standby, Standby, Up);
}

TEST_F(LinkManagerStateMachineTest, PostPckLossMetricsEvent)
{
setMuxStandby();

EXPECT_EQ(mDbInterfacePtr->mPostLinkProberMetricsInvokeCount, 0);
postLinkProberEvent(link_prober::LinkProberState::Unknown);

EXPECT_EQ(mDbInterfacePtr->mPostLinkProberMetricsInvokeCount, 1);
postLinkProberEvent(link_prober::LinkProberState::Active);

EXPECT_EQ(mDbInterfacePtr->mPostLinkProberMetricsInvokeCount, 2);
}

} /* namespace test */

0 comments on commit bd885ee

Please sign in to comment.