Skip to content

Commit

Permalink
fix gmock issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jcaiMR committed Sep 6, 2023
1 parent 19045b8 commit 63571bc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/mock_relay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,12 @@ TEST(relay, outbond_callback) {
EXPECT_GLOBAL_CALL(recvfrom, recvfrom(_, _, _, _, _, _)).Times(5).WillOnce(Return(0))
.WillOnce(Return(2)).WillOnce(Return(0))
.WillOnce(Return(msg_len)).WillOnce(Return(0));

char ethernet1[IF_NAMESIZE] = "Ethernet1";
char ptr[20] = "vlan";
EXPECT_GLOBAL_CALL(if_indextoname, if_indextoname(_, _)).Times(2).WillOnce(Return(nullptr))
.WillOnce(DoAll(SetArrayArgument<1>(ethernet1, ethernet1 + IF_NAMESIZE), Return(ptr)));

ASSERT_NO_THROW(outbond_callback(0, 0, state_db.get()));
// cover 0 < buffer_sz < sizeof(struct dhcpv6_msg)
ASSERT_NO_THROW(outbond_callback(0, 0, state_db.get()));
Expand Down

0 comments on commit 63571bc

Please sign in to comment.