Skip to content

Commit

Permalink
fix(pubsub): pass by reference explictly (#13220)
Browse files Browse the repository at this point in the history
  • Loading branch information
alevenberg committed Dec 4, 2023
1 parent 18c9048 commit 1e5f094
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions google/cloud/pubsub/internal/tracing_batch_sink_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ TEST(TracingBatchSink, AsyncPublishLargeBatch) {
EXPECT_CALL(*mock, AddMessage(_)).Times(batch_size);
EXPECT_CALL(*mock, AsyncPublish)
.WillOnce([](google::pubsub::v1::PublishRequest const& request) {
EXPECT_THAT(request, IsProtoEqual(MakeRequest(batch_size)));
EXPECT_THAT(request, IsProtoEqual(MakeRequest(kDefaultMaxLinks + 1)));
return make_ready_future(make_status_or(MakeResponse(request)));
});
auto span_catcher = InstallSpanCatcher();
Expand Down Expand Up @@ -337,8 +337,9 @@ TEST(TracingBatchSink, AsyncPublishBatchWithCustomLimit) {
auto mock = std::make_unique<pubsub_testing::MockBatchSink>();
EXPECT_CALL(*mock, AddMessage(_)).Times(kBatchSize);
EXPECT_CALL(*mock, AsyncPublish)
.WillOnce([](google::pubsub::v1::PublishRequest const& request) {
EXPECT_THAT(request, IsProtoEqual(MakeRequest(kBatchSize)));
.WillOnce([batch_size = kBatchSize](
google::pubsub::v1::PublishRequest const& request) {
EXPECT_THAT(request, IsProtoEqual(MakeRequest(batch_size)));
return make_ready_future(make_status_or(MakeResponse(request)));
});
auto batch_sink =
Expand Down

0 comments on commit 1e5f094

Please sign in to comment.