Github user onealj commented on a diff in the pull request:

    https://github.com/apache/commons-imaging/pull/27#discussion_r127632387
  
    --- Diff: 
src/test/java/org/apache/commons/imaging/formats/bmp/BmpWriterRgbTest.java ---
    @@ -0,0 +1,35 @@
    +package org.apache.commons.imaging.formats.bmp;
    +
    +import org.junit.Test;
    +
    +import java.awt.image.BufferedImage;
    +import java.util.Arrays;
    +
    +import static org.junit.Assert.assertEquals;
    +
    +/**
    + * Unit tests for class {@link BmpWriterRgb}.
    + *
    + * @date 13.07.2017
    + * @see BmpWriterRgb
    + *
    + **/
    +public class BmpWriterRgbTest{
    +
    +
    +    @Test
    +    public void testGetImageData() {
    +
    +        BmpWriterRgb bmpWriterRgb = new BmpWriterRgb();
    +        BufferedImage bufferedImage = new BufferedImage(2, 2, 5);
    +        byte[] byteArray = bmpWriterRgb.getImageData(bufferedImage);
    +
    +        assertEquals( 24, bmpWriterRgb.getBitsPerPixel() );
    +        assertEquals( 0, bmpWriterRgb.getPaletteSize() );
    +        assertEquals( 16, byteArray.length );
    +        assertEquals( "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]", 
Arrays.toString(byteArray) );
    --- End diff --
    
    I'd use `assertArrayEquals( new byte[] { 0,0,0, ... }, byteArray ); ` to 
avoid string serialization issues with some locales.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to