From 32c4ecb3db871a73c83ee02e4483f0c2496a68ea Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Thu, 28 Oct 2021 15:49:46 +0900 Subject: [PATCH] Fix -Wunused-but-set-variable in sdk/objc. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: None Change-Id: I7576db57b0a8d86fe7281176956c2efef78c1252 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236540 Reviewed-by: Mirko Bonadei Reviewed-by: Kári Helgason Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/main@{#35273} --- sdk/objc/api/peerconnection/RTCPeerConnectionFactory.mm | 7 ++++--- sdk/objc/unittests/RTCPeerConnectionTest.mm | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/objc/api/peerconnection/RTCPeerConnectionFactory.mm b/sdk/objc/api/peerconnection/RTCPeerConnectionFactory.mm index 1f0549ae8a..63ba934e3d 100644 --- a/sdk/objc/api/peerconnection/RTCPeerConnectionFactory.mm +++ b/sdk/objc/api/peerconnection/RTCPeerConnectionFactory.mm @@ -25,6 +25,7 @@ #import "base/RTCVideoDecoderFactory.h" #import "base/RTCVideoEncoderFactory.h" #import "helpers/NSString+StdString.h" +#include "rtc_base/checks.h" #include "sdk/objc/native/api/network_monitor_factory.h" #include "system_wrappers/include/field_trial.h" @@ -118,17 +119,17 @@ _networkThread = rtc::Thread::CreateWithSocketServer(); _networkThread->SetName("network_thread", _networkThread.get()); BOOL result = _networkThread->Start(); - NSAssert(result, @"Failed to start network thread."); + RTC_DCHECK(result) << "Failed to start network thread."; _workerThread = rtc::Thread::Create(); _workerThread->SetName("worker_thread", _workerThread.get()); result = _workerThread->Start(); - NSAssert(result, @"Failed to start worker thread."); + RTC_DCHECK(result) << "Failed to start worker thread."; _signalingThread = rtc::Thread::Create(); _signalingThread->SetName("signaling_thread", _signalingThread.get()); result = _signalingThread->Start(); - NSAssert(result, @"Failed to start signaling thread."); + RTC_DCHECK(result) << "Failed to start signaling thread."; } return self; } diff --git a/sdk/objc/unittests/RTCPeerConnectionTest.mm b/sdk/objc/unittests/RTCPeerConnectionTest.mm index 1d0ae2679e..19b3c8e69f 100644 --- a/sdk/objc/unittests/RTCPeerConnectionTest.mm +++ b/sdk/objc/unittests/RTCPeerConnectionTest.mm @@ -128,7 +128,6 @@ RTC_OBJC_TYPE(RTCPeerConnectionFactory) *factory = [[RTC_OBJC_TYPE(RTCPeerConnectionFactory) alloc] init]; - RTC_OBJC_TYPE(RTCConfiguration) * newConfig; std::unique_ptr pc_dependencies = std::make_unique(nullptr); @autoreleasepool { @@ -137,7 +136,7 @@ constraints:contraints dependencies:std::move(pc_dependencies) delegate:nil]; - newConfig = peerConnection.configuration; + ASSERT_NE(peerConnection, nil); } }