Implement value printer to prevent Valgrind errors in AudioPowerMonitor unit tests.
commitfc8a5000addb1013b873dd2ee07c6091cfc13988
authormiu@chromium.org <miu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Wed, 24 Jul 2013 01:03:42 +0000 (24 01:03 +0000)
committermiu@chromium.org <miu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Wed, 24 Jul 2013 01:03:42 +0000 (24 01:03 +0000)
treebe9ef9d75b2505aee477b62f9a61775d91abfda7
parent62a19f380ed779aaac511764db454f7cc9043f2a
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

Review URL: https://chromiumcodereview.appspot.com/19647013

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213304 0039d316-1c4b-4281-b951-d872f2087c98
media/audio/audio_power_monitor_unittest.cc
tools/valgrind/memcheck/suppressions.txt