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

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

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
BandwidthTest.java | 100% (1/1) | 100% (4/4) | 95% (144/152) | 99% (29,6/30)

### COVERAGE BREAKDOWN BY CLASS AND METHOD

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
class BandwidthTest | 100% (1/1) | 100% (4/4) | 95% (144/152) | 99% (29,6/30)
test2 (int): void |  | 100% (1/1) | 93% (53/57) | 98% (9,8/10)
test1 (int): void |  | 100% (1/1) | 94% (61/65) | 98% (10,8/11)
BandwidthTest (): void |  | 100% (1/1) | 100% (17/17) | 100% (4/4)
testAll (): void |  | 100% (1/1) | 100% (13/13) | 100% (5/5)

1 | package cz.vutbr.feec.packets.rsi;
2 |
3 | import junit.framework.Assert;
4 |
5 | import org.junit.Test;
6 |
7 | import cz.vutbr.feec.packets.PacketException;
8 | import cz.vutbr.feec.packets.rsi.BandwidthBlock;
9 |
10 | public class BandwidthTest {
11 | byte[] buf = new byte[100];
12 | // generate
13 | BandwidthBlock g = new BandwidthBlock();
14 | // read
15 | BandwidthBlock r = new BandwidthBlock();
16 | public void test1(int offset ) throws PacketException {
17 | g.receiver = true;
18 | g.sender = false;
19 | g.bandwidth = 100;
20 | int pktLen = g.generate(buf, 0);
21 |
22 | int res = r.parse(buf, 0, pktLen);
23 | res = r.parse(buf, 0, pktLen);
24 | Assert.assertTrue(res == pktLen);
25 | Assert.assertTrue(r.sender == false);
26 | Assert.assertTrue(r.receiver == true);
27 | Assert.assertTrue(r.bandwidth == 100);
28 | }
29 |
30 | public void test2(int offset ) throws PacketException {
31 | g.receiver = false;
32 | g.sender = true;
33 | g.bandwidth = 1 << 31;
34 | int pktLen = g.generate(buf, offset );
35 |
36 | int res = r.parse(buf, offset, pktLen);
37 | Assert.assertTrue(res == pktLen);
38 | Assert.assertTrue(r.receiver == false);
39 | Assert.assertTrue(r.sender == true);
40 | Assert.assertTrue(r.bandwidth == 1 << 31);
41 | }
42 |
43 | @Test
44 | public void testAll() throws PacketException {
45 | test1(0);
46 | test1(5);
47 |
48 | test2(0);
49 | test2(5);
50 | }
51 | }

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