Skip to content

Commit

Permalink
feat: add RS_Divide java test
Browse files Browse the repository at this point in the history
  • Loading branch information
furqaankhan committed Sep 19, 2023
1 parent fca0a32 commit 6743f85
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.opengis.referencing.FactoryException;

import java.awt.image.DataBuffer;
import java.util.Arrays;
import java.util.Random;

import static org.junit.Assert.*;
Expand Down Expand Up @@ -241,6 +240,21 @@ public void testMultiply() {
assertArrayEquals(expected, actual, 0.1d);
}

@Test
public void testDivide() {
double[] band1 = new double[] {20.43, 40.67, 60.91};
double[] band2 = new double[] {2.84, 5.26, 8.97};
double[] actual = MapAlgebra.divide(band1, band2);
double[] expected = new double[] {7.19, 7.73, 6.79};
assertArrayEquals(expected, actual, 0.001d);

band1 = new double[] {200, 400, 500};
band2 = new double[] {2, 2.5, 3};
actual = MapAlgebra.divide(band1, band2);
expected = new double[] {100.0, 160.0, 166.67};
assertArrayEquals(expected, actual, 0.01d);
}

@Test
public void testMapAlgebra() throws FactoryException {
Random random = new Random();
Expand Down

0 comments on commit 6743f85

Please sign in to comment.