Skip to content

Commit ed6319b

Browse files
committed
Add tests for TestSlice.class
1 parent 42e8df1 commit ed6319b

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

Diff for: src/test/java/com/jsoniter/TestSlice.java

+28
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,32 @@ public void test_hashcode() {
1919
assertEquals("hello", map.get(Slice.make("hello")));
2020
assertEquals("world", map.get(Slice.make("world")));
2121
}
22+
23+
public void test_equalsInputNotNullOutputFalse2() {
24+
25+
// Arrange
26+
final byte[] byteArray = {(byte)2, (byte)1};
27+
final Slice objectUnderTest = new Slice(byteArray, 0, 1073741825);
28+
final byte[] byteArray1 = {(byte)0};
29+
final Slice o = new Slice(byteArray1, 0, 1073741825);
30+
31+
// Act
32+
final boolean retval = objectUnderTest.equals(o);
33+
34+
// Assert result
35+
assertEquals(false, retval);
36+
}
37+
38+
public void test_equalsInputNotNullOutputFalse() {
39+
40+
// Arrange
41+
final Slice objectUnderTest = new Slice(null, 0, -2147483646);
42+
final Slice o = new Slice(null, 0, 2);
43+
44+
// Act
45+
final boolean retval = objectUnderTest.equals(o);
46+
47+
// Assert result
48+
assertEquals(false, retval);
49+
}
2250
}

0 commit comments

Comments
 (0)