@@ -133,25 +133,38 @@ private void testNoIpV4SearchTree(Reader reader) throws IOException {
133133 @ Test
134134 public void testDecodingTypesFile () throws IOException {
135135 this .testReader = new Reader (getFile ("MaxMind-DB-test-decoder.mmdb" ));
136- this .testDecodingTypes (this .testReader );
137- this .testDecodingTypesIntoModelObject (this .testReader );
138- this .testDecodingTypesIntoModelObjectBoxed (this .testReader );
136+ this .testDecodingTypes (this .testReader , true );
137+ this .testDecodingTypesIntoModelObject (this .testReader , true );
138+ this .testDecodingTypesIntoModelObjectBoxed (this .testReader , true );
139139 this .testDecodingTypesIntoModelWithList (this .testReader );
140140 }
141141
142142 @ Test
143143 public void testDecodingTypesStream () throws IOException {
144144 this .testReader = new Reader (getStream ("MaxMind-DB-test-decoder.mmdb" ));
145- this .testDecodingTypes (this .testReader );
146- this .testDecodingTypesIntoModelObject (this .testReader );
147- this .testDecodingTypesIntoModelObjectBoxed (this .testReader );
145+ this .testDecodingTypes (this .testReader , true );
146+ this .testDecodingTypesIntoModelObject (this .testReader , true );
147+ this .testDecodingTypesIntoModelObjectBoxed (this .testReader , true );
148148 this .testDecodingTypesIntoModelWithList (this .testReader );
149149 }
150150
151- private void testDecodingTypes (Reader reader ) throws IOException {
151+ @ Test
152+ public void testDecodingTypesPointerDecoderFile () throws IOException {
153+ this .testReader = new Reader (getFile ("MaxMind-DB-test-pointer-decoder.mmdb" ));
154+ this .testDecodingTypes (this .testReader , false );
155+ this .testDecodingTypesIntoModelObject (this .testReader , false );
156+ this .testDecodingTypesIntoModelObjectBoxed (this .testReader , false );
157+ this .testDecodingTypesIntoModelWithList (this .testReader );
158+ }
159+
160+ private void testDecodingTypes (Reader reader , boolean booleanValue ) throws IOException {
152161 Map record = reader .get (InetAddress .getByName ("::1.1.1.0" ), Map .class );
153162
154- assertTrue ((boolean ) record .get ("boolean" ));
163+ if (booleanValue ) {
164+ assertTrue ((boolean ) record .get ("boolean" ));
165+ } else {
166+ assertFalse ((boolean ) record .get ("boolean" ));
167+ }
155168
156169 assertArrayEquals (new byte []{0 , 0 , 0 , (byte ) 42 }, (byte []) record
157170 .get ("bytes" ));
@@ -191,11 +204,15 @@ private void testDecodingTypes(Reader reader) throws IOException {
191204 (BigInteger ) record .get ("uint128" ));
192205 }
193206
194- private void testDecodingTypesIntoModelObject (Reader reader )
207+ private void testDecodingTypesIntoModelObject (Reader reader , boolean booleanValue )
195208 throws IOException {
196209 TestModel model = reader .get (InetAddress .getByName ("::1.1.1.0" ), TestModel .class );
197210
198- assertTrue (model .booleanField );
211+ if (booleanValue ) {
212+ assertTrue (model .booleanField );
213+ } else {
214+ assertFalse (model .booleanField );
215+ }
199216
200217 assertArrayEquals (new byte []{0 , 0 , 0 , (byte ) 42 }, model .bytesField );
201218
@@ -307,11 +324,15 @@ public MapXModel (
307324 }
308325 }
309326
310- private void testDecodingTypesIntoModelObjectBoxed (Reader reader )
327+ private void testDecodingTypesIntoModelObjectBoxed (Reader reader , boolean booleanValue )
311328 throws IOException {
312329 TestModelBoxed model = reader .get (InetAddress .getByName ("::1.1.1.0" ), TestModelBoxed .class );
313330
314- assertTrue (model .booleanField );
331+ if (booleanValue ) {
332+ assertTrue (model .booleanField );
333+ } else {
334+ assertFalse (model .booleanField );
335+ }
315336
316337 assertArrayEquals (new byte []{0 , 0 , 0 , (byte ) 42 }, model .bytesField );
317338
0 commit comments