Skip to content

Commit 5843945

Browse files
committed
Improving code coverage
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@794525 13f79535-47bb-0310-9956-ffa450edef68
1 parent 817b4ee commit 5843945

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

src/test/org/apache/commons/codec/digest/DigestUtilsTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,8 @@ public void testShaHex() throws IOException {
157157
DigestUtils.shaHex(new ByteArrayInputStream(testData)));
158158

159159
}
160+
161+
public void testConstructable() {
162+
new DigestUtils();
163+
}
160164
}

src/test/org/apache/commons/codec/language/CaverphoneTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,10 @@ public void testSpecificationExamples() {
5959
}
6060
}
6161

62+
public void testIsCaverphoneEquals() {
63+
Caverphone caverphone = new Caverphone();
64+
assertFalse("Caverphone encodings should not be equal", caverphone.isCaverphoneEqual("Peter", "Stevenson"));
65+
assertTrue("Caverphone encodings should be equal", caverphone.isCaverphoneEqual("Peter", "Peady"));
66+
}
67+
6268
}

src/test/org/apache/commons/codec/language/SoundexTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,4 +400,14 @@ public void testNewInstance2() {
400400
public void testNewInstance3() {
401401
assertEquals("W452", new Soundex(Soundex.US_ENGLISH_MAPPING_STRING).soundex("Williams"));
402402
}
403+
404+
public void testSoundexUtilsNullBehaviour() {
405+
assertEquals(null, SoundexUtils.clean(null));
406+
assertEquals("", SoundexUtils.clean(""));
407+
assertEquals(0, SoundexUtils.differenceEncoded(null, ""));
408+
assertEquals(0, SoundexUtils.differenceEncoded("", null));
409+
}
410+
public void testSoundexUtilsConstructable() {
411+
new SoundexUtils();
412+
}
403413
}

0 commit comments

Comments
 (0)