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 |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 // Invalid event number. | 275 // Invalid event number. |
276 event.event_no = -1; | 276 event.event_no = -1; |
277 EXPECT_EQ(DtmfBuffer::kInvalidEventParameters, buffer.InsertEvent(event)); | 277 EXPECT_EQ(DtmfBuffer::kInvalidEventParameters, buffer.InsertEvent(event)); |
278 event.event_no = 16; | 278 event.event_no = 16; |
279 EXPECT_EQ(DtmfBuffer::kInvalidEventParameters, buffer.InsertEvent(event)); | 279 EXPECT_EQ(DtmfBuffer::kInvalidEventParameters, buffer.InsertEvent(event)); |
280 event.event_no = 0; // Valid value; | 280 event.event_no = 0; // Valid value; |
281 | 281 |
282 // Invalid volume. | 282 // Invalid volume. |
283 event.volume = -1; | 283 event.volume = -1; |
284 EXPECT_EQ(DtmfBuffer::kInvalidEventParameters, buffer.InsertEvent(event)); | 284 EXPECT_EQ(DtmfBuffer::kInvalidEventParameters, buffer.InsertEvent(event)); |
285 event.volume = 37; | 285 event.volume = 64; |
286 EXPECT_EQ(DtmfBuffer::kInvalidEventParameters, buffer.InsertEvent(event)); | 286 EXPECT_EQ(DtmfBuffer::kInvalidEventParameters, buffer.InsertEvent(event)); |
287 event.volume = 0; // Valid value; | 287 event.volume = 0; // Valid value; |
288 | 288 |
289 // Invalid duration. | 289 // Invalid duration. |
290 event.duration = -1; | 290 event.duration = -1; |
291 EXPECT_EQ(DtmfBuffer::kInvalidEventParameters, buffer.InsertEvent(event)); | 291 EXPECT_EQ(DtmfBuffer::kInvalidEventParameters, buffer.InsertEvent(event)); |
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 |