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

Unified Diff: webrtc/api/statscollector_unittest.cc

Issue 2622413005: Replace use of ASSERT in test code. (Closed)
Patch Set: Created 3 years, 11 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/api/statscollector_unittest.cc
diff --git a/webrtc/api/statscollector_unittest.cc b/webrtc/api/statscollector_unittest.cc
index 5a0614ee4103f908a31857339a6dc0a438fff589..c5ef6a1cc6a5cbc22b2f962ff704699371530c8b 100644
--- a/webrtc/api/statscollector_unittest.cc
+++ b/webrtc/api/statscollector_unittest.cc
@@ -26,6 +26,7 @@
#include "webrtc/api/test/mock_webrtcsession.h"
#include "webrtc/api/videotrack.h"
#include "webrtc/base/base64.h"
+#include "webrtc/base/checks.h"
#include "webrtc/base/fakesslidentity.h"
#include "webrtc/base/gunit.h"
#include "webrtc/base/network.h"
@@ -609,7 +610,7 @@ class StatsCollectorTest : public testing::Test {
StatsReports* reports) {
// A track can't have both sender report and recv report at the same time
// for now, this might change in the future though.
- ASSERT((voice_sender_info == NULL) ^ (voice_receiver_info == NULL));
+ RTC_CHECK((voice_sender_info == NULL) ^ (voice_receiver_info == NULL));
kwiberg-webrtc 2017/01/17 09:39:25 You may not be able to use ASSERT_* here. Will EXP
nisse-webrtc 2017/01/17 12:19:21 EXPECT_TRUE seems to work. But I think RTC_CHECK
kwiberg-webrtc 2017/01/17 13:52:47 Sounds reasonable.
// Instruct the session to return stats containing the transport channel.
InitSessionStats(vc_name);
@@ -1306,7 +1307,7 @@ TEST_F(StatsCollectorTest, IceCandidateReport) {
uint32_t priority = 1000;
cricket::Candidate c;
- ASSERT(c.id().length() > 0);
+ RTC_CHECK(c.id().length() > 0);
kwiberg-webrtc 2017/01/17 09:39:25 ASSERT_* or EXPECT_*
nisse-webrtc 2017/01/17 12:19:21 Changed to EXPECT_GT.
c.set_type(cricket::LOCAL_PORT_TYPE);
c.set_protocol(cricket::UDP_PROTOCOL_NAME);
c.set_address(local_address);
@@ -1316,7 +1317,7 @@ TEST_F(StatsCollectorTest, IceCandidateReport) {
EXPECT_EQ("Cand-" + c.id(), report_id);
c = cricket::Candidate();
- ASSERT(c.id().length() > 0);
+ RTC_CHECK(c.id().length() > 0);
c.set_type(cricket::PRFLX_PORT_TYPE);
c.set_protocol(cricket::UDP_PROTOCOL_NAME);
c.set_address(remote_address);

Powered by Google App Engine
This is Rietveld 408576698