OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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_coding/neteq/dtmf_buffer.h" | 11 #include "webrtc/modules/audio_coding/neteq/dtmf_buffer.h" |
12 | 12 |
13 #ifdef WIN32 | 13 #ifdef WIN32 |
14 #include <winsock2.h> // ntohl() | 14 #include <winsock2.h> // ntohl() |
15 #else | 15 #else |
16 #include <arpa/inet.h> // ntohl() | 16 #include <arpa/inet.h> // ntohl() |
17 #endif | 17 #endif |
18 | 18 |
19 #include <iostream> | 19 #include <iostream> |
20 | 20 |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "webrtc/test/gtest.h" |
22 | 22 |
23 // Modify the tests so that they pass with the modifications done to DtmfBuffer | 23 // Modify the tests so that they pass with the modifications done to DtmfBuffer |
24 // for backwards bit-exactness. Once bit-exactness is no longer required, this | 24 // for backwards bit-exactness. Once bit-exactness is no longer required, this |
25 // #define should be removed (and the code that it enables). | 25 // #define should be removed (and the code that it enables). |
26 #define LEGACY_BITEXACT | 26 #define LEGACY_BITEXACT |
27 | 27 |
28 namespace webrtc { | 28 namespace webrtc { |
29 | 29 |
30 static int sample_rate_hz = 8000; | 30 static int sample_rate_hz = 8000; |
31 | 31 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 event.duration = 0; | 292 event.duration = 0; |
293 EXPECT_EQ(DtmfBuffer::kInvalidEventParameters, buffer.InsertEvent(event)); | 293 EXPECT_EQ(DtmfBuffer::kInvalidEventParameters, buffer.InsertEvent(event)); |
294 event.duration = 0xFFFF + 1; | 294 event.duration = 0xFFFF + 1; |
295 EXPECT_EQ(DtmfBuffer::kInvalidEventParameters, buffer.InsertEvent(event)); | 295 EXPECT_EQ(DtmfBuffer::kInvalidEventParameters, buffer.InsertEvent(event)); |
296 event.duration = 1; // Valid value; | 296 event.duration = 1; // Valid value; |
297 | 297 |
298 // Finish with a valid event, just to verify that all is ok. | 298 // Finish with a valid event, just to verify that all is ok. |
299 EXPECT_EQ(DtmfBuffer::kOK, buffer.InsertEvent(event)); | 299 EXPECT_EQ(DtmfBuffer::kOK, buffer.InsertEvent(event)); |
300 } | 300 } |
301 } // namespace webrtc | 301 } // namespace webrtc |
OLD | NEW |