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

Issue 2622413005: Replace use of ASSERT in test code. (Closed)

Created:
3 years, 11 months ago by nisse-webrtc
Modified:
3 years, 11 months ago
Reviewers:
kwiberg-webrtc
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

Replace use of ASSERT in test code. In top level test functions, replaced with gtest ASSERT_*. In helper methods in main test files, replaced with EXPECT_* or RTC_DCHECK on a case-by-case basis. In separate mock/fake classes used by tests (which might be of some use also in tests of third-party applications), ASSERT was replaced with RTC_CHECK, using git grep -l ' ASSERT(' | grep -v common.h | \ xargs sed -i 's/ ASSERT(/ RTC_CHECK(/' followed by additional includes of base/checks.h in affected files, and git cl format. BUG=webrtc:6424 Review-Url: https://codereview.webrtc.org/2622413005 Cr-Commit-Position: refs/heads/master@{#16150} Committed: https://chromium.googlesource.com/external/webrtc/+/c8ee882753f5240018445a1ce5761fd1c3196b4e

Patch Set 1 #

Total comments: 32

Patch Set 2 : Use ASSERT_* or EXPECT_*, not RTC_CHECK, in top-level test functions. #

Patch Set 3 : Changed one RTC_CHECK to EXPECT_TRUE. #

Patch Set 4 : Fixed signed/unsigned comparison. #

Patch Set 5 : Rebased. #

Patch Set 6 : Fixed another signed/unsigned comparison. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+75 lines, -61 lines) Patch
M webrtc/api/rtcstatscollector_unittest.cc View 1 2 3 4 7 chunks +10 lines, -10 lines 0 comments Download
M webrtc/api/statscollector_unittest.cc View 1 2 3 4 5 3 chunks +3 lines, -3 lines 0 comments Download
M webrtc/api/test/fakeaudiocapturemodule.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M webrtc/api/test/fakedatachannelprovider.h View 6 chunks +9 lines, -6 lines 0 comments Download
M webrtc/api/test/mockpeerconnectionobservers.h View 1 2 3 4 3 chunks +9 lines, -8 lines 0 comments Download
M webrtc/api/webrtcsession_unittest.cc View 1 3 chunks +4 lines, -4 lines 0 comments Download
M webrtc/base/network_unittest.cc View 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/base/optionsfile_unittest.cc View 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/base/sharedexclusivelock_unittest.cc View 3 chunks +7 lines, -6 lines 0 comments Download
M webrtc/base/sslstreamadapter_unittest.cc View 3 chunks +3 lines, -2 lines 0 comments Download
M webrtc/base/testutils.h View 3 chunks +3 lines, -2 lines 0 comments Download
M webrtc/p2p/base/dtlstransportchannel_unittest.cc View 1 2 4 chunks +4 lines, -3 lines 0 comments Download
M webrtc/p2p/base/p2ptransportchannel_unittest.cc View 3 chunks +3 lines, -2 lines 0 comments Download
M webrtc/p2p/base/port_unittest.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M webrtc/p2p/base/turnport_unittest.cc View 3 chunks +3 lines, -2 lines 0 comments Download
M webrtc/pc/channel_unittest.cc View 1 2 3 4 2 chunks +3 lines, -2 lines 0 comments Download
M webrtc/pc/mediasession_unittest.cc View 2 chunks +3 lines, -2 lines 0 comments Download

Messages

Total messages: 30 (12 generated)
nisse-webrtc
Next step. It seems appropriate with RTC_CHECK (not RTC_DCHECK) in test code.
3 years, 11 months ago (2017-01-13 15:32:14 UTC) #2
the sun
On 2017/01/13 15:32:14, nisse-webrtc wrote: > Next step. It seems appropriate with RTC_CHECK (not RTC_DCHECK) ...
3 years, 11 months ago (2017-01-13 15:35:57 UTC) #3
nisse-webrtc
On 2017/01/13 15:35:57, the sun wrote: > On 2017/01/13 15:32:14, nisse-webrtc wrote: > > Next ...
3 years, 11 months ago (2017-01-13 15:44:25 UTC) #4
nisse-webrtc
Ping?
3 years, 11 months ago (2017-01-16 15:22:08 UTC) #6
the sun
On 2017/01/16 15:22:08, nisse-webrtc wrote: > Ping? I didn't intend to add myself as reviewer. ...
3 years, 11 months ago (2017-01-16 18:21:49 UTC) #9
kwiberg-webrtc
I've made a number of comments that apply to more than just the line they're ...
3 years, 11 months ago (2017-01-17 09:39:25 UTC) #10
kwiberg-webrtc
On 2017/01/16 18:21:49, the sun wrote: > On 2017/01/16 15:22:08, nisse-webrtc wrote: > > Ping? ...
3 years, 11 months ago (2017-01-17 09:39:50 UTC) #11
nisse-webrtc
I've updated the simple things: Top-level test functions should use EXPECT_* or ASSERT_*, not RTC_CHECK. ...
3 years, 11 months ago (2017-01-17 12:19:21 UTC) #12
kwiberg-webrtc
https://codereview.webrtc.org/2622413005/diff/1/webrtc/api/statscollector_unittest.cc File webrtc/api/statscollector_unittest.cc (right): https://codereview.webrtc.org/2622413005/diff/1/webrtc/api/statscollector_unittest.cc#newcode613 webrtc/api/statscollector_unittest.cc:613: RTC_CHECK((voice_sender_info == NULL) ^ (voice_receiver_info == NULL)); On 2017/01/17 ...
3 years, 11 months ago (2017-01-17 13:52:47 UTC) #13
kwiberg-webrtc
On 2017/01/17 12:19:21, nisse-webrtc wrote: > I've updated the simple things: Top-level test functions should ...
3 years, 11 months ago (2017-01-17 13:55:34 UTC) #14
nisse-webrtc
https://codereview.webrtc.org/2622413005/diff/1/webrtc/p2p/base/dtlstransportchannel_unittest.cc File webrtc/p2p/base/dtlstransportchannel_unittest.cc (right): https://codereview.webrtc.org/2622413005/diff/1/webrtc/p2p/base/dtlstransportchannel_unittest.cc#newcode304 webrtc/p2p/base/dtlstransportchannel_unittest.cc:304: RTC_CHECK(channel < channels_.size()); On 2017/01/17 13:52:47, kwiberg-webrtc wrote: > ...
3 years, 11 months ago (2017-01-17 15:00:04 UTC) #15
kwiberg-webrtc
https://codereview.webrtc.org/2622413005/diff/1/webrtc/p2p/base/dtlstransportchannel_unittest.cc File webrtc/p2p/base/dtlstransportchannel_unittest.cc (right): https://codereview.webrtc.org/2622413005/diff/1/webrtc/p2p/base/dtlstransportchannel_unittest.cc#newcode304 webrtc/p2p/base/dtlstransportchannel_unittest.cc:304: RTC_CHECK(channel < channels_.size()); On 2017/01/17 15:00:03, nisse-webrtc wrote: > ...
3 years, 11 months ago (2017-01-18 09:40:35 UTC) #16
nisse-webrtc
Changed the RTC_CHECK(certificate_) check. If you think this is ok, I'll just revise the description ...
3 years, 11 months ago (2017-01-18 12:12:31 UTC) #17
kwiberg-webrtc
lgtm, with the commit message changed as you proposed. https://codereview.webrtc.org/2622413005/diff/1/webrtc/p2p/base/dtlstransportchannel_unittest.cc File webrtc/p2p/base/dtlstransportchannel_unittest.cc (right): https://codereview.webrtc.org/2622413005/diff/1/webrtc/p2p/base/dtlstransportchannel_unittest.cc#newcode304 webrtc/p2p/base/dtlstransportchannel_unittest.cc:304: ...
3 years, 11 months ago (2017-01-18 12:35:34 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2622413005/40001
3 years, 11 months ago (2017-01-18 12:50:36 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: win_baremetal on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/win_baremetal/builds/17777)
3 years, 11 months ago (2017-01-18 13:02:08 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2622413005/80019
3 years, 11 months ago (2017-01-18 14:04:50 UTC) #27
commit-bot: I haz the power
3 years, 11 months ago (2017-01-18 15:21:02 UTC) #30
Message was sent while issue was closed.
Committed patchset #6 (id:80019) as
https://chromium.googlesource.com/external/webrtc/+/c8ee882753f5240018445a1ce...

Powered by Google App Engine
This is Rietveld 408576698