Changeset 6175 in josm for trunk/test


Ignore:
Timestamp:
2013-08-22T14:41:30+02:00 (11 years ago)
Author:
Don-vip
Message:

see #8902 - Small performance enhancements / coding style (patches by shinigami):

  • bytestohexstring.diff: byte[] to hex string change + small test
  • collfix.diff : problem in generic collection definition
  • styleiteration.diff: useless iteration to do end of list
  • environment.diff: Environment - merge chained ops (each created copy of env.) to one
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java

    r5772 r6175  
    5151        Assert.assertEquals("abc", Utils.strip(someWhite+"abc"+someWhite));
    5252    }
     53
     54    /**
     55     * Test of {@link Utils#toHexString} method.
     56     */
     57    @Test
     58    public void testToHexString(){
     59        Assert.assertEquals("", Utils.toHexString(null));
     60        Assert.assertEquals("", Utils.toHexString(new byte[0]));
     61        Assert.assertEquals("01", Utils.toHexString(new byte[]{0x1}));
     62        Assert.assertEquals("0102", Utils.toHexString(new byte[]{0x1,0x2}));
     63        Assert.assertEquals("12", Utils.toHexString(new byte[]{0x12}));
     64        Assert.assertEquals("127f", Utils.toHexString(new byte[]{0x12, 0x7f}));
     65        Assert.assertEquals("fedc", Utils.toHexString(new byte[]{(byte) 0xfe, (byte) 0xdc}));
     66    }
    5367}
Note: See TracChangeset for help on using the changeset viewer.