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

Unified Diff: media/base/vector_math_unittest.cc

Issue 156783003: Enhance AudioSplicer to crossfade marked splice frames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Created 6 years, 10 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
« no previous file with comments | « media/base/vector_math.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/vector_math_unittest.cc
diff --git a/media/base/vector_math_unittest.cc b/media/base/vector_math_unittest.cc
index bed609098b8a2bced06604402f7caa8341caac9b..95433ca475ed0b5b03b7db52016fc1519c8ac046 100644
--- a/media/base/vector_math_unittest.cc
+++ b/media/base/vector_math_unittest.cc
@@ -44,12 +44,12 @@ class VectorMathTest : public testing::Test {
void VerifyOutput(float value) {
for (int i = 0; i < kVectorSize; ++i)
- ASSERT_FLOAT_EQ(output_vector_.get()[i], value);
+ ASSERT_FLOAT_EQ(output_vector_[i], value);
}
protected:
- scoped_ptr<float, base::AlignedFreeDeleter> input_vector_;
- scoped_ptr<float, base::AlignedFreeDeleter> output_vector_;
+ scoped_ptr<float[], base::AlignedFreeDeleter> input_vector_;
+ scoped_ptr<float[], base::AlignedFreeDeleter> output_vector_;
DISALLOW_COPY_AND_ASSIGN(VectorMathTest);
};
@@ -138,7 +138,15 @@ TEST_F(VectorMathTest, FMUL) {
#endif
}
-namespace {
+TEST_F(VectorMathTest, Crossfade) {
+ FillTestVectors(0, 1);
+ vector_math::Crossfade(
+ input_vector_.get(), kVectorSize, output_vector_.get());
+ for (int i = 0; i < kVectorSize; ++i) {
+ ASSERT_FLOAT_EQ(i / static_cast<float>(kVectorSize), output_vector_[i])
+ << "i=" << i;
+ }
+}
class EWMATestScenario {
public:
@@ -248,8 +256,6 @@ class EWMATestScenario {
float expected_max_;
};
-} // namespace
-
typedef testing::TestWithParam<EWMATestScenario> VectorMathEWMAAndMaxPowerTest;
TEST_P(VectorMathEWMAAndMaxPowerTest, Correctness) {
« no previous file with comments | « media/base/vector_math.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698