MCPcopy Create free account
hub / github.com/amazon-ion/ion-java / testInts

Method testInts

src/test/java/com/amazon/ion/IntTest.java:104–127  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102
103
104 @Test
105 public void testInts()
106 {
107 IonInt value = (IonInt) oneValue("1");
108 assertFalse(value.isNullValue());
109 assertArrayEquals(new String[0], value.getTypeAnnotations());
110 assertEquals(1, value.intValue());
111 assertEquals(1L, value.longValue());
112
113 value = (IonInt) oneValue("a::" + Integer.MAX_VALUE);
114 assertFalse(value.isNullValue());
115 checkAnnotation("a", value);
116 assertEquals(Integer.MAX_VALUE, value.intValue());
117 assertEquals(Integer.MAX_VALUE, value.longValue());
118
119 // Ensure that annotation makes it through value mods
120 modifyInt(value);
121 checkAnnotation("a", value);
122
123 value = (IonInt) oneValue("" + Integer.MIN_VALUE);
124 assertFalse(value.isNullValue());
125 assertArrayEquals(new String[0], value.getTypeAnnotations());
126 assertEquals(Integer.MIN_VALUE, value.intValue());
127 }
128
129 @Test
130 public void testPositiveSign()

Callers

nothing calls this directly

Calls 8

intValueMethod · 0.95
longValueMethod · 0.95
modifyIntMethod · 0.95
isNullValueMethod · 0.65
getTypeAnnotationsMethod · 0.65
oneValueMethod · 0.45
assertEqualsMethod · 0.45
checkAnnotationMethod · 0.45

Tested by

no test coverage detected