Changeset 18473 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2022-06-08T17:48:47+02:00 (3 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/data/protobuf
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/protobuf/ProtobufRecordTest.java
r17862 r18473 4 4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 5 6 6 import java.io.ByteArrayOutputStream; 7 7 import java.io.IOException; 8 8 … … 16 16 void testFixed32() throws IOException { 17 17 ProtobufParser parser = new ProtobufParser(ProtobufTest.toByteArray(new int[] {0x0d, 0x00, 0x00, 0x80, 0x3f})); 18 ProtobufRecord thirtyTwoBit = new ProtobufRecord( parser);18 ProtobufRecord thirtyTwoBit = new ProtobufRecord(new ByteArrayOutputStream(), parser); 19 19 assertEquals(WireType.THIRTY_TWO_BIT, thirtyTwoBit.getType()); 20 20 assertEquals(1f, thirtyTwoBit.asFloat()); … … 24 24 void testUnknown() throws IOException { 25 25 ProtobufParser parser = new ProtobufParser(ProtobufTest.toByteArray(new int[] {0x0f, 0x00, 0x00, 0x80, 0x3f})); 26 ProtobufRecord unknown = new ProtobufRecord( parser);26 ProtobufRecord unknown = new ProtobufRecord(new ByteArrayOutputStream(), parser); 27 27 assertEquals(WireType.UNKNOWN, unknown.getType()); 28 28 assertEquals(0, unknown.getBytes().length); -
trunk/test/unit/org/openstreetmap/josm/data/protobuf/ProtobufTest.java
r18037 r18473 8 8 import java.awt.geom.Ellipse2D; 9 9 import java.io.ByteArrayInputStream; 10 import java.io.ByteArrayOutputStream; 10 11 import java.io.File; 11 12 import java.io.IOException; … … 172 173 void testSimpleMessage() throws IOException { 173 174 ProtobufParser parser = new ProtobufParser(new byte[] {(byte) 0x08, (byte) 0x96, (byte) 0x01}); 174 ProtobufRecord record = new ProtobufRecord( parser);175 ProtobufRecord record = new ProtobufRecord(new ByteArrayOutputStream(), parser); 175 176 assertEquals(WireType.VARINT, record.getType()); 176 177 assertEquals(150, record.asUnsignedVarInt().intValue());
Note:
See TracChangeset
for help on using the changeset viewer.