forked from json-iterator/java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestOmitValue.java
More file actions
137 lines (95 loc) · 3.4 KB
/
TestOmitValue.java
File metadata and controls
137 lines (95 loc) · 3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
package com.jsoniter;
import com.jsoniter.spi.OmitValue.*;
import junit.framework.TestCase;
public class TestOmitValue extends TestCase {
public void test_shouldOmitInputPositiveOutputFalse() {
// Arrange
final ZeroByte objectUnderTest = new ZeroByte();
final Object val = (byte)1;
// Act
final boolean retval = objectUnderTest.shouldOmit(val);
// Assert result
assertEquals(false, retval);
}
public void test_shouldOmitInputPositiveOutputFalse2() {
// Arrange
final ZeroInt objectUnderTest = new ZeroInt();
final Object val = 1;
// Act
final boolean retval = objectUnderTest.shouldOmit(val);
// Assert result
assertEquals(false, retval);
}
public void test_shouldOmitInputPositiveOutputFalse3() {
// Arrange
final ZeroLong objectUnderTest = new ZeroLong();
final Object val = 1L;
// Act
final boolean retval = objectUnderTest.shouldOmit(val);
// Assert result
assertEquals(false, retval);
}
public void test_shouldOmitInputZeroOutputTrue() {
// Arrange
final ZeroLong objectUnderTest = new ZeroLong();
final Object val = 0L;
// Act
final boolean retval = objectUnderTest.shouldOmit(val);
// Assert result
assertEquals(true, retval);
}
public void test_shouldOmitInputPositiveOutputFalse4() {
// Arrange
final ZeroShort objectUnderTest = new ZeroShort();
final Object val = (short)1;
// Act
final boolean retval = objectUnderTest.shouldOmit(val);
// Assert result
assertEquals(false, retval);
}
public void test_shouldOmitInputTrueOutputFalse() {
// Arrange
final False objectUnderTest = new False();
final Object val = true;
// Act
final boolean retval = objectUnderTest.shouldOmit(val);
// Assert result
assertEquals(false, retval);
}
public void test_shouldOmitInputNotNullOutputFalse() {
// Arrange
final ZeroChar objectUnderTest = new ZeroChar();
final Object val = '\u0001';
// Act
final boolean retval = objectUnderTest.shouldOmit(val);
// Assert result
assertEquals(false, retval);
}
public void test_shouldOmitInputPositiveOutputFalse5() {
// Arrange
final ZeroDouble objectUnderTest = new ZeroDouble();
final Object val = 0x0.0000000000001p-1022 /* 4.94066e-324 */;
// Act
final boolean retval = objectUnderTest.shouldOmit(val);
// Assert result
assertEquals(false, retval);
}
public void test_shouldOmitInputZeroOutputTrue2() {
// Arrange
final ZeroDouble objectUnderTest = new ZeroDouble();
final Object val = 0.0;
// Act
final boolean retval = objectUnderTest.shouldOmit(val);
// Assert result
assertEquals(true, retval);
}
public void test_shouldOmitInputPositiveOutputFalse6() {
// Arrange
final ZeroFloat objectUnderTest = new ZeroFloat();
final Object val = 0x1p-149f /* 1.4013e-45 */;
// Act
final boolean retval = objectUnderTest.shouldOmit(val);
// Assert result
assertEquals(false, retval);
}
}