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

Issue 1413053002: Change to use local Random object instead of global rand() in the RtcEventLog unit test. (Closed)

Created:
5 years, 2 months ago by terelius
Modified:
5 years, 1 month ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Change to use local Random object instead of global rand() in the RtcEventLog unit test. Removed Rand(int low, int high) since that function outputs results that are non-random and/or outside the interval if low is negative. Added new Uniform(uint32_t, uint32_t) function to replace Rand(int low, int high). Changed various unit tests to use the new functions. BUG= Committed: https://crrev.com/56b1128c8f14ea307994c27671e8884812b2704a Cr-Commit-Position: refs/heads/master@{#10541}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Updated WebRTC unit tests to use the new functions in Random #

Total comments: 11

Patch Set 3 : Pass PRNG by pointer rather than by reference #

Patch Set 4 : Renamed Random::Uniform to Random::Rand and made Rand<float> a template specialization #

Patch Set 5 : Rebase #

Total comments: 4

Patch Set 6 : Comments from pbos #

Unified diffs Side-by-side diffs Delta from patch set Stats (+121 lines, -77 lines) Patch
M webrtc/call/rtc_event_log_unittest.cc View 1 2 3 4 8 chunks +63 lines, -56 lines 0 comments Download
M webrtc/modules/remote_bitrate_estimator/bwe_simulations.cc View 1 2 3 3 chunks +9 lines, -9 lines 0 comments Download
M webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M webrtc/test/random.h View 1 2 3 3 chunks +26 lines, -4 lines 0 comments Download
M webrtc/test/random.cc View 1 2 3 4 5 3 chunks +21 lines, -6 lines 0 comments Download

Messages

Total messages: 34 (10 generated)
terelius
This CL replaces the global rand() state with a local object as requested by solenberg@ ...
5 years, 2 months ago (2015-10-19 10:16:26 UTC) #2
the sun
https://codereview.webrtc.org/1413053002/diff/1/webrtc/call/rtc_event_log_unittest.cc File webrtc/call/rtc_event_log_unittest.cc (right): https://codereview.webrtc.org/1413053002/diff/1/webrtc/call/rtc_event_log_unittest.cc#newcode310 webrtc/call/rtc_event_log_unittest.cc:310: csrcs.push_back(prng.Rand(0, 1000000000)); Duplicated a lot. Would it make sense ...
5 years, 2 months ago (2015-10-19 11:47:26 UTC) #3
terelius
https://codereview.webrtc.org/1413053002/diff/1/webrtc/call/rtc_event_log_unittest.cc File webrtc/call/rtc_event_log_unittest.cc (right): https://codereview.webrtc.org/1413053002/diff/1/webrtc/call/rtc_event_log_unittest.cc#newcode310 webrtc/call/rtc_event_log_unittest.cc:310: csrcs.push_back(prng.Rand(0, 1000000000)); On 2015/10/19 11:47:26, the sun wrote: > ...
5 years, 2 months ago (2015-10-21 12:18:28 UTC) #5
stefan-webrtc
Please make sure this builds with ./webrtc/build/gyp_webrtc -Denable_bwe_test_logging=1 as that code uses this prng. https://codereview.webrtc.org/1413053002/diff/20001/webrtc/call/rtc_event_log_unittest.cc ...
5 years, 2 months ago (2015-10-22 09:41:22 UTC) #6
the sun
https://codereview.webrtc.org/1413053002/diff/20001/webrtc/test/random.cc File webrtc/test/random.cc (right): https://codereview.webrtc.org/1413053002/diff/20001/webrtc/test/random.cc#newcode30 webrtc/test/random.cc:30: } On 2015/10/22 09:41:22, stefan-webrtc (holmer) wrote: > Should ...
5 years, 2 months ago (2015-10-22 12:30:38 UTC) #7
terelius
https://codereview.webrtc.org/1413053002/diff/20001/webrtc/call/rtc_event_log_unittest.cc File webrtc/call/rtc_event_log_unittest.cc (right): https://codereview.webrtc.org/1413053002/diff/20001/webrtc/call/rtc_event_log_unittest.cc#newcode293 webrtc/call/rtc_event_log_unittest.cc:293: test::Random& prng) { On 2015/10/22 09:41:22, stefan-webrtc (holmer) wrote: ...
5 years, 1 month ago (2015-10-26 18:18:41 UTC) #8
the sun
https://codereview.webrtc.org/1413053002/diff/20001/webrtc/test/random.h File webrtc/test/random.h (right): https://codereview.webrtc.org/1413053002/diff/20001/webrtc/test/random.h#newcode31 webrtc/test/random.h:31: T Rand() { On 2015/10/26 18:18:41, terelius wrote: > ...
5 years, 1 month ago (2015-10-27 09:03:12 UTC) #9
terelius
https://codereview.webrtc.org/1413053002/diff/20001/webrtc/test/random.h File webrtc/test/random.h (right): https://codereview.webrtc.org/1413053002/diff/20001/webrtc/test/random.h#newcode31 webrtc/test/random.h:31: T Rand() { On 2015/10/27 09:03:12, the sun wrote: ...
5 years, 1 month ago (2015-10-29 12:54:04 UTC) #10
stefan-webrtc
lgtm from my side.
5 years, 1 month ago (2015-10-29 12:57:28 UTC) #11
the sun
On 2015/10/29 12:54:04, terelius wrote: > https://codereview.webrtc.org/1413053002/diff/20001/webrtc/test/random.h > File webrtc/test/random.h (right): > > https://codereview.webrtc.org/1413053002/diff/20001/webrtc/test/random.h#newcode31 > ...
5 years, 1 month ago (2015-10-29 13:05:59 UTC) #12
terelius
On 2015/10/29 13:05:59, the sun wrote: > On 2015/10/29 12:54:04, terelius wrote: > > https://codereview.webrtc.org/1413053002/diff/20001/webrtc/test/random.h ...
5 years, 1 month ago (2015-10-29 13:10:32 UTC) #13
the sun
On 2015/10/29 13:10:32, terelius wrote: > On 2015/10/29 13:05:59, the sun wrote: > > On ...
5 years, 1 month ago (2015-10-29 13:31:05 UTC) #14
terelius
On 2015/10/29 13:31:05, the sun wrote: > On 2015/10/29 13:10:32, terelius wrote: > > On ...
5 years, 1 month ago (2015-10-30 11:11:44 UTC) #15
the sun
Nice! LGTM
5 years, 1 month ago (2015-10-30 11:41:54 UTC) #16
ivoc
Nice, LGTM.
5 years, 1 month ago (2015-11-02 15:21:42 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1413053002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1413053002/80001
5 years, 1 month ago (2015-11-06 09:58:56 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: presubmit on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/presubmit/builds/1583)
5 years, 1 month ago (2015-11-06 10:06:39 UTC) #22
terelius
Peter, could you review random.* please?
5 years, 1 month ago (2015-11-06 10:21:14 UTC) #25
pbos-webrtc
lgtm with nits fixed https://codereview.webrtc.org/1413053002/diff/80001/webrtc/test/random.cc File webrtc/test/random.cc (right): https://codereview.webrtc.org/1413053002/diff/80001/webrtc/test/random.cc#newcode26 webrtc/test/random.cc:26: result = b_ * (result ...
5 years, 1 month ago (2015-11-06 10:35:21 UTC) #26
terelius
https://codereview.webrtc.org/1413053002/diff/80001/webrtc/test/random.cc File webrtc/test/random.cc (right): https://codereview.webrtc.org/1413053002/diff/80001/webrtc/test/random.cc#newcode26 webrtc/test/random.cc:26: result = b_ * (result + 1); On 2015/11/06 ...
5 years, 1 month ago (2015-11-06 10:59:20 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1413053002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1413053002/80001
5 years, 1 month ago (2015-11-06 10:59:53 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1413053002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1413053002/100001
5 years, 1 month ago (2015-11-06 11:47:09 UTC) #32
commit-bot: I haz the power
Committed patchset #6 (id:100001)
5 years, 1 month ago (2015-11-06 13:13:58 UTC) #33
commit-bot: I haz the power
5 years, 1 month ago (2015-11-06 13:14:11 UTC) #34
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/56b1128c8f14ea307994c27671e8884812b2704a
Cr-Commit-Position: refs/heads/master@{#10541}

Powered by Google App Engine
This is Rietveld 408576698