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

Unified Diff: webrtc/modules/audio_processing/test/bitexactness_tools.cc

Issue 1804373002: Added a bitexactness test for the voice activity detector in the audio processing module. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@LevelEstimatorBitExactness_CL
Patch Set: Created 4 years, 9 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
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,

Powered by Google App Engine
This is Rietveld 408576698