| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include "webrtc/modules/audio_processing/transient/wpd_node.h" | 11 #include "webrtc/modules/audio_processing/transient/wpd_node.h" |
| 12 | 12 |
| 13 #include <string.h> | 13 #include <string.h> |
| 14 | 14 |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "webrtc/test/gtest.h" |
| 16 | 16 |
| 17 namespace webrtc { | 17 namespace webrtc { |
| 18 | 18 |
| 19 static const size_t kDataLength = 5; | 19 static const size_t kDataLength = 5; |
| 20 static const float kTolerance = 0.0001f; | 20 static const float kTolerance = 0.0001f; |
| 21 | 21 |
| 22 static const size_t kParentDataLength = kDataLength * 2; | 22 static const size_t kParentDataLength = kDataLength * 2; |
| 23 static const float kParentData[kParentDataLength] = | 23 static const float kParentData[kParentDataLength] = |
| 24 {1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 9.f, 10.f}; | 24 {1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 9.f, 10.f}; |
| 25 | 25 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 56 | 56 |
| 57 TEST(WPDNodeTest, ExpectedErrorReturnValue) { | 57 TEST(WPDNodeTest, ExpectedErrorReturnValue) { |
| 58 WPDNode node(kDataLength, kCoefficients, kCoefficientsLength); | 58 WPDNode node(kDataLength, kCoefficients, kCoefficientsLength); |
| 59 EXPECT_EQ(-1, node.Update(kParentData, kParentDataLength - 1)); | 59 EXPECT_EQ(-1, node.Update(kParentData, kParentDataLength - 1)); |
| 60 EXPECT_EQ(-1, node.Update(NULL, kParentDataLength)); | 60 EXPECT_EQ(-1, node.Update(NULL, kParentDataLength)); |
| 61 EXPECT_EQ(-1, node.set_data(kParentData, kDataLength - 1)); | 61 EXPECT_EQ(-1, node.set_data(kParentData, kDataLength - 1)); |
| 62 EXPECT_EQ(-1, node.set_data(NULL, kDataLength)); | 62 EXPECT_EQ(-1, node.set_data(NULL, kDataLength)); |
| 63 } | 63 } |
| 64 | 64 |
| 65 } // namespace webrtc | 65 } // namespace webrtc |
| OLD | NEW |