Update SimplexNoiseTest.java

This commit is contained in:
Libin Yang 2019-05-09 16:34:58 +08:00 committed by GitHub
parent 39806e3fe6
commit 46e52f4378
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,5 @@
package src.test.java.com.generation;
import static org.junit.jupiter.api.Assertions.*;
import java.awt.Color;
import java.awt.image.BufferedImage;
@ -9,8 +8,9 @@ import java.io.InputStream;
import javax.imageio.ImageIO;
import org.junit.jupiter.api.Test;
import org.junit.Assert;
import org.junit.Test;
import src.main.java.com.generation.SimplexNoise;
public class SimplexNoiseTest {
@ -31,19 +31,18 @@ public class SimplexNoiseTest {
image = ImageIO.read(in);
assertEquals(WIDTH, image.getWidth());
assertEquals(HEIGHT, image.getHeight());
Assert.assertEquals(WIDTH, image.getWidth());
Assert.assertEquals(HEIGHT, image.getHeight());
} catch (IOException | IllegalArgumentException exception) {
fail(exception);
}
for (int x = 0; x < WIDTH; x++) {
for (int y = 0; y < HEIGHT; y++) {
assertEquals(new Color(image.getRGB(x, y)).getRed(), (int)(heightmap[x][y] * 255));
Assert.assertEquals(new Color(image.getRGB(x, y)).getRed(), (int) (heightmap[x][y] * 255));
}
}
}