DescriptionImplement 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. #
Messages
Total messages: 7 (0 generated)
|