Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Jan 3, 2024
1 parent 7e30701 commit 1d76b54
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions interface/common/resdb_state_accessor_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ using ::google::protobuf::util::MessageDifferencer;
using ::testing::ElementsAre;
using ::testing::Invoke;
using ::testing::Test;
using ::testing::Return;

void AddReplicaToList(const std::string& ip, int port,
std::vector<ReplicaInfo>* replica) {
Expand Down Expand Up @@ -89,11 +90,13 @@ TEST_F(StateClientTest, GetAllReplicaState) {
.Times(1)
.WillRepeatedly(Invoke([&](const std::string& ip, int port) {
auto client = std::make_unique<MockNetChannel>(ip, port);
LOG(ERROR)<<"get net:";
EXPECT_CALL(*client, RecvRawMessage)
.WillRepeatedly(Invoke([&](google::protobuf::Message* message) {
*reinterpret_cast<ReplicaState*>(message) = state;
return 0;
}));
ON_CALL(*client, SendRequest).WillByDefault(Return(0));
return client;
}));
auto ret = client.GetReplicaStates();
Expand Down

0 comments on commit 1d76b54

Please sign in to comment.