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

Unified Diff: media/audio/audio_power_monitor_unittest.cc

Issue 19647013: Implement value printer to prevent Valgrind errors in AudioPowerMonitor unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Implement operator<< instead. Created 7 years, 5 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
« no previous file with comments | « no previous file | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_power_monitor_unittest.cc
diff --git a/media/audio/audio_power_monitor_unittest.cc b/media/audio/audio_power_monitor_unittest.cc
index baea1391aa5d83f83b5f661404af4f80037f3948..938837d972986f7d6eca3dc304d4360d548dd979 100644
--- a/media/audio/audio_power_monitor_unittest.cc
+++ b/media/audio/audio_power_monitor_unittest.cc
@@ -82,6 +82,15 @@ class TestScenario {
scoped_ptr<AudioBus> bus_;
};
+// Value printer for TestScenario. Required to prevent Valgrind "access to
+// uninitialized memory" errors (http://crbug.com/263315).
+::std::ostream& operator<<(::std::ostream& os, const TestScenario& ts) {
+ return os << "{" << ts.data().channels() << "-channel signal} --> {"
+ << ts.expected_power() << " dBFS, "
+ << (ts.expected_clipped() ? "clipped" : "not clipped")
+ << "}";
+}
+
// An observer that receives power measurements. Each power measurement should
// should make progress towards the goal value.
class MeasurementObserver {
« no previous file with comments | « no previous file | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698