EMMA Coverage Report (generated Tue Dec 18 20:38:46 CET 2007)
[all classes][cz.vutbr.feec.packets.rtcp]

## COVERAGE SUMMARY FOR SOURCE FILE [ReceiveReportPacketTest.java]

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
ReceiveReportPacketTest.java | 100% (1/1) | 100% (2/2) | 97% (259/267) | 99% (72,5/73)

### COVERAGE BREAKDOWN BY CLASS AND METHOD

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
class ReceiveReportPacketTest | 100% (1/1) | 100% (2/2) | 97% (259/267) | 99% (72,5/73)
testRRPacket (): void |  | 100% (1/1) | 97% (252/260) | 99% (70,5/71)
ReceiveReportPacketTest (): void |  | 100% (1/1) | 100% (7/7) | 100% (2/2)

1 | package cz.vutbr.feec.packets.rtcp;
2 |
3 | import org.junit.Assert;
4 | import org.junit.Test;
5 |
6 | import cz.vutbr.feec.packets.PacketGenerateException;
7 | import cz.vutbr.feec.packets.PacketParseException;
8 |
9 | public class ReceiveReportPacketTest {
10 |
11 | byte[] buffer = new byte[500];
12 |
13 | @Test
14 | public void testRRPacket() throws PacketGenerateException,
15 | PacketParseException {
16 |
17 | ReceiverReportPacket generateRRPacket = new ReceiverReportPacket();
18 |
19 | generateRRPacket.setVersion(2);
20 | generateRRPacket.setPadding(1);
21 | generateRRPacket.setPayloadtype(RTCPConstants.RTCP_RR);
22 | generateRRPacket.setSSRC(234234);
23 |
24 | ReportBlock block1 = new ReportBlock();
25 | ReportBlock block2 = new ReportBlock();
26 | ReportBlock block3 = new ReportBlock();
27 | ReportBlock block4 = new ReportBlock();
28 | ReportBlock block5 = new ReportBlock();
29 |
30 | block1.setSSRC(1);
31 | block2.setSSRC(2);
32 | block3.setSSRC(3);
33 | block4.setSSRC(4);
34 | block5.setSSRC(5);
35 |
36 | block1.setFractionLost(50);
37 | block2.setFractionLost(51);
38 | block3.setFractionLost(52);
39 | block4.setFractionLost(53);
40 | block5.setFractionLost(54);
41 |
42 | block1.setCumulativeNumofPackLost(100);
43 | block2.setCumulativeNumofPackLost(200);
44 | block3.setCumulativeNumofPackLost(300);
45 | block4.setCumulativeNumofPackLost(400);
46 | block5.setCumulativeNumofPackLost(500);
47 |
48 | block1.setExHIseqNumRec(1000);
49 | block2.setExHIseqNumRec(1001);
50 | block3.setExHIseqNumRec(1002);
51 | block4.setExHIseqNumRec(1003);
52 | block5.setExHIseqNumRec(1004);
53 |
54 | block1.setInterArrJitter(555);
55 | block2.setInterArrJitter(556);
56 | block3.setInterArrJitter(557);
57 | block4.setInterArrJitter(558);
58 | block5.setInterArrJitter(559);
59 |
60 | block1.setLSR(2);
61 | block2.setLSR(3);
62 | block3.setLSR(4);
63 | block4.setLSR(5);
64 | block5.setLSR(6);
65 |
66 | block1.setDLSR(2);
67 | block2.setDLSR(3);
68 | block3.setDLSR(4);
69 | block4.setDLSR(5);
70 | block5.setDLSR(6);
71 |
72 | generateRRPacket.addReportBlock(block1);
73 | generateRRPacket.addReportBlock(block2);
74 | generateRRPacket.addReportBlock(block3);
75 | generateRRPacket.addReportBlock(block4);
76 | generateRRPacket.addReportBlock(block5);
77 |
78 | // tento parametr se nastavuje sam dle poctu vlozenych bloku
79 | // generateRRPacket.setReportCount(generateRRPacket.getReportCount());
80 |
81 | int length = generateRRPacket.generate(buffer, 0);
82 |
83 | ReceiverReportPacket parseRRpacket = new ReceiverReportPacket();
84 |
85 | int length2 = parseRRpacket.parse(buffer, 0, length);
86 |
87 | Assert.assertTrue("Musi byt zarovnano na 4 byty", length % 4 == 0);
88 | Assert.assertTrue(length == length2);
89 | Assert.assertTrue(generateRRPacket.getVersion() == parseRRpacket
90 | .getVersion());
91 | Assert.assertTrue(generateRRPacket.getPadding() == parseRRpacket
92 | .getPadding());
93 | Assert.assertTrue(generateRRPacket.getReportCount() == parseRRpacket
94 | .getReportCount());
95 | Assert.assertTrue(generateRRPacket.getPayloadtype() == parseRRpacket
96 | .getPayloadtype());
97 | Assert.assertTrue(generateRRPacket.getLength() == parseRRpacket
98 | .getLength());
99 | Assert
100 | .assertTrue(generateRRPacket.getSSRC() == parseRRpacket
101 | .getSSRC());
102 |
103 | for (int i = 0; i < 5; i++) {
104 | Assert.assertTrue(generateRRPacket.getReportBlock(i).equals(
105 | parseRRpacket.getReportBlock(i)));
106 | }
107 |
108 | }
109 |
110 | }

[all classes][cz.vutbr.feec.packets.rtcp]
EMMA 2.0.5312 EclEmma Fix 1 (C) Vladimir Roubtsov