Chromium Code Reviews| Index: webrtc/modules/audio_processing/test/bitexactness_tools.cc |
| diff --git a/webrtc/modules/audio_processing/test/bitexactness_tools.cc b/webrtc/modules/audio_processing/test/bitexactness_tools.cc |
| index 881471145c9f948eb9b1f10d4841da61672b554b..b6f84730e894aaabe8722de0e70d3a374958c376 100644 |
| --- a/webrtc/modules/audio_processing/test/bitexactness_tools.cc |
| +++ b/webrtc/modules/audio_processing/test/bitexactness_tools.cc |
| @@ -17,6 +17,29 @@ |
| namespace webrtc { |
| namespace test { |
| +::testing::AssertionResult AssertBoolsNotEqual(const char* m_expr, |
|
hlundin-webrtc
2016/03/16 15:50:20
No, use EXPECT_EQ instead.
peah-webrtc
2016/03/18 05:56:05
Done.
|
| + const char* n_expr, |
| + const bool& output, |
| + const bool& reference) { |
| + // If the values are deemed not to be similar, return a report of the |
| + // difference. |
| + if (output != reference) { |
| + // Lambda function that produces a string containing the bool name. |
| + auto bool_description = [](bool v) { |
| + if (v) { |
| + return std::string("true"); |
| + } else { |
| + return std::string("false"); |
| + } |
| + }; |
| + |
| + return ::testing::AssertionFailure() |
| + << "Actual: " << bool_description(output) << std::endl |
| + << "Expected: " << bool_description(reference) << std::endl; |
| + } |
| + return ::testing::AssertionSuccess(); |
| +} |
| + |
| ::testing::AssertionResult AssertIntegersNotEqual(const char* m_expr, |
| const char* n_expr, |
| const int& output, |