Debian Codegraph @

test/uk/me/parabola/imgfmt/app/labelenc/Format6EncoderTest.java

raw symbols SCIP
1 /*
2 * Copyright (C) 2014.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 or
6 * version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
12 */
13 package uk.me.parabola.imgfmt.app.labelenc;
14
15 import org.junit.Test;
16 import static org.junit.Assert.*;
17
18 public class Format6EncoderTest {
19 /**
20 * Note that this is essentially a special case. We need a zero length input to map to the first
21 * empty entry in the table.
22 */
23 @Test
24 public void testEmptyGivesZeroResult() {
25 Format6Encoder fmt = new Format6Encoder();
26
27 EncodedText enc = fmt.encodeText("");
28 assertEquals(0, enc.getLength());
29 }
30
31 @Test
32 public void testEmptyGivesNullChars() {
33 Format6Encoder fmt = new Format6Encoder();
34
35 EncodedText enc = fmt.encodeText("");
36 assertNull(enc.getChars());
37 }
38
39 @Test
40 public void testEmptyGivesNullCtext() {
41 Format6Encoder fmt = new Format6Encoder();
42
43 EncodedText enc = fmt.encodeText("");
44 assertNull(enc.getCtext());
45 }
46 }