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

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

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
RTPTest.java | 100% (1/1) | 100% (3/3) | 63% (84/133) | 73% (19,8/27)

### COVERAGE BREAKDOWN BY CLASS AND METHOD

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
class RTPTest | 100% (1/1) | 100% (3/3) | 63% (84/133) | 73% (19,8/27)
testAppPacket (): void |  | 100% (1/1) | 52% (16/31) | 50% (3/6)
testRTPPacket (boolean, int, int, long, byte []): void |  | 100% (1/1) | 64% (61/95) | 78% (14,8/19)
RTPTest (): 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 | import cz.vutbr.feec.packets.rtp.RTPPacket;
9 | import cz.vutbr.feec.session.rtprtcp.internal.RTCPConstants;
10 |
11 | public class RTPTest {
12 |
13 | byte[] buffer = new byte[100];
14 |
15 | @Test
16 | public void testAppPacket() throws PacketParseException,
17 | PacketGenerateException {
18 |
19 | byte[] data = new byte[50];
20 | for (int i = 0; i < data.length; i++) {
21 | data[i] = (byte)i;
22 | }
23 |
24 | testRTPPacket(true, 100, 12, 1L<<31, data);
25 | testRTPPacket(false, 101, 5, 1L<<31, data);
26 | }
27 |
28 | public void testRTPPacket(boolean marker, int payloadType, int seqNum, long ssrc, byte[] data) throws PacketParseException,
29 | PacketGenerateException {
30 |
31 | RTPPacket packet = new RTPPacket();
32 | packet.setVersion(RTCPConstants.VERSION);
33 | packet.setPadding(RTCPConstants.PADDING);
34 | packet.setExtension(RTCPConstants.EXTENSION);
35 | int m = marker ? 1 : 0;
36 | packet.setMarker(m);
37 | packet.setPayloadtype(payloadType);
38 | packet.setSeqNum(seqNum);
39 | packet.setTimeStamp(System.currentTimeMillis());
40 | packet.setSSRC(ssrc);
41 | packet.setData(data, 0, data.length);
42 |
43 |
44 | int pktLen = packet.generate(buffer, 5);
45 |
46 | RTPPacket par = new RTPPacket();
47 | int resLen = par.parse(buffer, 5, pktLen);
48 |
49 | Assert.assertTrue(pktLen == resLen);
50 | Assert.assertTrue(pktLen == (data.length+4));
51 |
52 | Assert.assertTrue(par.getData()[0] == 0);
53 | Assert.assertTrue(par.getData()[1] == 1);
54 |
55 | }
56 | }

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