add test for #1511

This commit is contained in:
Connor Tumbleson 2017-06-08 16:51:16 -04:00
parent bd62f7e3e5
commit b6751f893c
2 changed files with 24 additions and 0 deletions

View File

@ -371,6 +371,30 @@ public class BuildAndDecodeTest {
assertEquals(controlImage.getRGB(30, 30), testImage.getRGB(30, 30));
}
@Test
public void issue1511Test() throws BrutException, IOException {
char slash = File.separatorChar;
String location = slash + "res" + slash + "drawable-xxhdpi" + slash;
File control = new File((sTestOrigDir + location), "textfield_activated_holo_dark.9.png");
File test = new File((sTestNewDir + location), "textfield_activated_holo_dark.9.png");
BufferedImage controlImage = ImageIO.read(control);
BufferedImage testImage = ImageIO.read(test);
// Check entire image as we cannot mess this up
final int w = controlImage.getWidth(),
h = controlImage.getHeight();
final int[] controlImageGrid = controlImage.getRGB(0, 0, w, h, null, 0, w);
final int[] testImageGrid = testImage.getRGB(0, 0, w, h, null, 0, w);
for (int i = 0; i < controlImageGrid.length; i++) {
assertEquals("Image lost Optical Bounds at i = " + i, controlImageGrid[i], testImageGrid[i]);
}
}
@Test
public void drawableXxhdpiTest() throws BrutException, IOException {
compareResFolder("drawable-xxhdpi");