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

Issue 19647013: Implement value printer to prevent Valgrind errors in AudioPowerMonitor unit tests. (Closed)

Created:
7 years, 5 months ago by miu
Modified:
7 years, 5 months ago
Reviewers:
DaleCurtis
CC:
chromium-reviews, feature-media-reviews_chromium.org, glider+watch_chromium.org, timurrrr+watch_chromium.org, bruening+watch_chromium.org
Visibility:
Public.

Description

Implement value printer to prevent Valgrind errors in AudioPowerMonitor unit tests. The Google Test templates provide a default value printer function that naively dumps all bytes in the range [&object, &object + sizeof(object)). However, due to the memory layout of the TestScenario class (on some platforms), there was a hole of uninitialized memory being read from; and this triggered Valgrind errors. The solution here is to implement an ostream& operator<<(ostream&, const TestScenario&) function that will not read from uninitialized memory regions. BUG=263315 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=213304

Patch Set 1 #

Total comments: 2

Patch Set 2 : Implement operator<< instead. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -9 lines) Patch
M media/audio/audio_power_monitor_unittest.cc View 1 1 chunk +9 lines, -0 lines 0 comments Download
M tools/valgrind/memcheck/suppressions.txt View 1 chunk +0 lines, -9 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
miu
Dale, Here's the fix for the Valgrind foo. A few simple LOC solves everything... Thanks, ...
7 years, 5 months ago (2013-07-23 21:37:35 UTC) #1
DaleCurtis
https://codereview.chromium.org/19647013/diff/1/media/audio/audio_power_monitor_unittest.cc File media/audio/audio_power_monitor_unittest.cc (right): https://codereview.chromium.org/19647013/diff/1/media/audio/audio_power_monitor_unittest.cc#newcode87 media/audio/audio_power_monitor_unittest.cc:87: void PrintTo(const TestScenario& ts, ::std::ostream* os) { Instead of ...
7 years, 5 months ago (2013-07-23 21:46:15 UTC) #2
miu
https://codereview.chromium.org/19647013/diff/1/media/audio/audio_power_monitor_unittest.cc File media/audio/audio_power_monitor_unittest.cc (right): https://codereview.chromium.org/19647013/diff/1/media/audio/audio_power_monitor_unittest.cc#newcode87 media/audio/audio_power_monitor_unittest.cc:87: void PrintTo(const TestScenario& ts, ::std::ostream* os) { On 2013/07/23 ...
7 years, 5 months ago (2013-07-23 22:03:41 UTC) #3
DaleCurtis
lgtm
7 years, 5 months ago (2013-07-23 22:10:13 UTC) #4
miu
On 2013/07/23 22:10:13, DaleCurtis wrote: > lgtm Thanks!
7 years, 5 months ago (2013-07-23 22:12:10 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/miu@chromium.org/19647013/5001
7 years, 5 months ago (2013-07-23 22:14:40 UTC) #6
commit-bot: I haz the power
7 years, 5 months ago (2013-07-24 01:03:43 UTC) #7
Message was sent while issue was closed.
Change committed as 213304

Powered by Google App Engine
This is Rietveld 408576698