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

Unified Diff: webrtc/audio/utility/audio_frame_operations_unittest.cc

Issue 2424173003: Move functionality out from AudioFrame and into AudioFrameOperations. (Closed)
Patch Set: Updated deprecation notice, minimized diff to original unittest. Created 4 years, 1 month 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/audio/utility/audio_frame_operations_unittest.cc
diff --git a/webrtc/modules/utility/source/audio_frame_operations_unittest.cc b/webrtc/audio/utility/audio_frame_operations_unittest.cc
similarity index 96%
rename from webrtc/modules/utility/source/audio_frame_operations_unittest.cc
rename to webrtc/audio/utility/audio_frame_operations_unittest.cc
index 8f83e051ee19ffc8af6f8533532bc4c926be1f2b..4f7d0753605aa4eba61e37261d084954a957af36 100644
--- a/webrtc/modules/utility/source/audio_frame_operations_unittest.cc
+++ b/webrtc/audio/utility/audio_frame_operations_unittest.cc
@@ -8,9 +8,9 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include "webrtc/audio/utility/audio_frame_operations.h"
#include "webrtc/base/checks.h"
#include "webrtc/modules/include/module_common_types.h"
-#include "webrtc/modules/utility/include/audio_frame_operations.h"
#include "webrtc/test/gtest.h"
namespace webrtc {
@@ -365,5 +365,15 @@ TEST_F(AudioFrameOperationsTest, ScaleWithSatSucceeds) {
VerifyFramesAreEqual(scaled_frame, frame_);
}
+TEST(ClampToInt16, TestCases) {
+ EXPECT_EQ(0x0000, ClampToInt16(0x00000000));
+ EXPECT_EQ(0x0001, ClampToInt16(0x00000001));
+ EXPECT_EQ(0x7FFF, ClampToInt16(0x00007FFF));
+ EXPECT_EQ(0x7FFF, ClampToInt16(0x7FFFFFFF));
+ EXPECT_EQ(-0x0001, ClampToInt16(-0x00000001));
+ EXPECT_EQ(-0x8000, ClampToInt16(-0x8000));
+ EXPECT_EQ(-0x8000, ClampToInt16(-0x7FFFFFFF));
+}
+
} // namespace
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698