OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 metric.Gmin = 8; | 44 metric.Gmin = 8; |
45 metric.Rfactor = 9; | 45 metric.Rfactor = 9; |
46 metric.extRfactor = 10; | 46 metric.extRfactor = 10; |
47 metric.MOSLQ = 11; | 47 metric.MOSLQ = 11; |
48 metric.MOSCQ = 12; | 48 metric.MOSCQ = 12; |
49 metric.RXconfig = 13; | 49 metric.RXconfig = 13; |
50 metric.JBnominal = 0x5556; | 50 metric.JBnominal = 0x5556; |
51 metric.JBmax = 0x6667; | 51 metric.JBmax = 0x6667; |
52 metric.JBabsMax = 0x7778; | 52 metric.JBabsMax = 0x7778; |
53 VoipMetric metric_block; | 53 VoipMetric metric_block; |
54 metric_block.SetMediaSsrc(kRemoteSsrc); | 54 metric_block.To(kRemoteSsrc); |
55 metric_block.SetVoipMetric(metric); | 55 metric_block.WithVoipMetric(metric); |
56 | 56 |
57 metric_block.Create(buffer); | 57 metric_block.Create(buffer); |
58 EXPECT_EQ(0, memcmp(buffer, kBlock, kBlockSizeBytes)); | 58 EXPECT_EQ(0, memcmp(buffer, kBlock, kBlockSizeBytes)); |
59 } | 59 } |
60 | 60 |
61 TEST(RtcpPacketVoipMetricTest, Parse) { | 61 TEST(RtcpPacketVoipMetricTest, Parse) { |
62 VoipMetric read_metric; | 62 VoipMetric read_metric; |
63 read_metric.Parse(kBlock); | 63 read_metric.Parse(kBlock); |
64 | 64 |
65 // Run checks on const object to ensure all accessors have const modifier. | 65 // Run checks on const object to ensure all accessors have const modifier. |
(...skipping 18 matching lines...) Expand all Loading... |
84 EXPECT_EQ(12, parsed.voip_metric().MOSCQ); | 84 EXPECT_EQ(12, parsed.voip_metric().MOSCQ); |
85 EXPECT_EQ(13, parsed.voip_metric().RXconfig); | 85 EXPECT_EQ(13, parsed.voip_metric().RXconfig); |
86 EXPECT_EQ(0x5556, parsed.voip_metric().JBnominal); | 86 EXPECT_EQ(0x5556, parsed.voip_metric().JBnominal); |
87 EXPECT_EQ(0x6667, parsed.voip_metric().JBmax); | 87 EXPECT_EQ(0x6667, parsed.voip_metric().JBmax); |
88 EXPECT_EQ(0x7778, parsed.voip_metric().JBabsMax); | 88 EXPECT_EQ(0x7778, parsed.voip_metric().JBabsMax); |
89 } | 89 } |
90 | 90 |
91 } // namespace | 91 } // namespace |
92 } // namespace rtcp | 92 } // namespace rtcp |
93 } // namespace webrtc | 93 } // namespace webrtc |
OLD | NEW |