@@ -98,7 +98,9 @@ TEST_F(EventMemoryMonitorTest, TestCallbackCalledWhenHighEventChanges) {
9898 WriteMemoryEventsFile (events_file_->GetPath (), 0 , 0 );
9999
100100 auto callback_latch = std::make_shared<boost::latch>(1 );
101- KillWorkersCallback callback = [callback_latch]() { callback_latch->count_down (); };
101+ KillWorkersCallback callback = [callback_latch](const std::string &) {
102+ callback_latch->count_down ();
103+ };
102104
103105 StatusSetOr<std::unique_ptr<EventMemoryMonitor>, StatusT::IOError> result =
104106 EventMemoryMonitor::Create (std::move (mock_cgroup_dir_->GetPath ()),
@@ -116,7 +118,9 @@ TEST_F(EventMemoryMonitorTest, TestNoCallbackWhenValuesUnchanged) {
116118 WriteMemoryEventsFile (events_file_->GetPath (), 0 , 0 );
117119
118120 auto callback_latch = std::make_shared<boost::latch>(1 );
119- KillWorkersCallback callback = [callback_latch]() { callback_latch->count_down (); };
121+ KillWorkersCallback callback = [callback_latch](const std::string &) {
122+ callback_latch->count_down ();
123+ };
120124
121125 StatusSetOr<std::unique_ptr<EventMemoryMonitor>, StatusT::IOError> result =
122126 EventMemoryMonitor::Create (mock_cgroup_dir_->GetPath (), callback);
@@ -133,7 +137,9 @@ TEST_F(EventMemoryMonitorTest, TestNoCallbackWhenIrrelevantEventChanges) {
133137 WriteMemoryEventsFile (events_file_->GetPath (), 0 , 0 );
134138
135139 auto callback_latch = std::make_shared<boost::latch>(1 );
136- KillWorkersCallback callback = [callback_latch]() { callback_latch->count_down (); };
140+ KillWorkersCallback callback = [callback_latch](const std::string &) {
141+ callback_latch->count_down ();
142+ };
137143
138144 StatusSetOr<std::unique_ptr<EventMemoryMonitor>, StatusT::IOError> result =
139145 EventMemoryMonitor::Create (mock_cgroup_dir_->GetPath (), callback);
@@ -153,16 +159,17 @@ TEST_F(EventMemoryMonitorTest, TestMultipleCallbacksOnMultipleChanges) {
153159 auto latch2 = std::make_shared<boost::latch>(1 );
154160 auto latch3 = std::make_shared<boost::latch>(1 );
155161 std::atomic<int > callback_count{0 };
156- KillWorkersCallback callback = [&callback_count, latch1, latch2, latch3]() {
157- int count = ++callback_count;
158- if (count == 1 ) {
159- latch1->count_down ();
160- } else if (count == 2 ) {
161- latch2->count_down ();
162- } else if (count == 3 ) {
163- latch3->count_down ();
164- }
165- };
162+ KillWorkersCallback callback =
163+ [&callback_count, latch1, latch2, latch3](const std::string &) {
164+ int count = ++callback_count;
165+ if (count == 1 ) {
166+ latch1->count_down ();
167+ } else if (count == 2 ) {
168+ latch2->count_down ();
169+ } else if (count == 3 ) {
170+ latch3->count_down ();
171+ }
172+ };
166173
167174 StatusSetOr<std::unique_ptr<EventMemoryMonitor>, StatusT::IOError> result =
168175 EventMemoryMonitor::Create (mock_cgroup_dir_->GetPath (), callback);
0 commit comments