Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Unified Diff: webrtc/pc/channel_unittest.cc

Issue 3005433002: Fix places that trigger no-unused-lambda-capture (Closed)
Patch Set: Rebased Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/pc/channel_unittest.cc
diff --git a/webrtc/pc/channel_unittest.cc b/webrtc/pc/channel_unittest.cc
index fa9d3da52005d3f3dfc1448e2faf4681806e1ec6..0eaffc426dcfbe3b29afb1eae8dae8a9d7c35dc0 100644
--- a/webrtc/pc/channel_unittest.cc
+++ b/webrtc/pc/channel_unittest.cc
@@ -1205,9 +1205,13 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
// Tests that when the transport channel signals a candidate pair change
// event, the media channel will receive a call on the network route change.
void TestNetworkRouteChanges() {
- constexpr uint16_t kLocalNetId = 1;
- constexpr uint16_t kRemoteNetId = 2;
- constexpr int kLastPacketId = 100;
+ // These would have been declared as constexpr, but then some compilers
+ // require them to be captured in the lambda, and other compilers complain
+ // about no-ununused-lambda-capture. Keeping them as normal variables was
+ // the easiest work-around.
+ uint16_t kLocalNetId = 1;
+ uint16_t kRemoteNetId = 2;
+ int kLastPacketId = 100;
kwiberg-webrtc 2017/08/23 11:35:59 Shouldn't they at least be const?
eladalon 2017/08/23 11:42:53 No, it doesn't work if they are. Please see my ans
kwiberg-webrtc 2017/08/23 11:56:40 Ugh. This is really bad. What if we make them enu
eladalon 2017/08/23 12:17:30 Interesting suggestion. I'm trying out another sug
CreateChannels(0, 0);
@@ -1227,7 +1231,7 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
EXPECT_FALSE(media_channel1->last_network_route().connected);
media_channel1->set_num_network_route_changes(0);
- network_thread_->Invoke<void>(RTC_FROM_HERE, [this, media_channel1,
+ network_thread_->Invoke<void>(RTC_FROM_HERE, [this,
kLocalNetId, kRemoteNetId,
kLastPacketId] {
// The transport channel becomes connected.

Powered by Google App Engine
This is Rietveld 408576698