Added test for generating realNDArrays

Signed-off-by: Burkhard Mittelbach <wasabi37a@googlemail.com>
This commit is contained in:
Burkhard Mittelbach 2018-05-01 17:12:19 +02:00
parent d22a4ed657
commit 5ec4c8690c
No known key found for this signature in database
GPG Key ID: 6B3F613A894472DF

View File

@ -18,4 +18,17 @@ class RealNDFieldTest {
val product = array1*array2 val product = array1*array2
assertEquals(0.0, product[2, 2].toDouble(), 0.1) assertEquals(0.0, product[2, 2].toDouble(), 0.1)
} }
@Test
fun testGeneration() {
val array = real2DArray(3, 3) { i, j -> (i * 10 + j).toDouble() }
for(i in 0..2){
for(j in 0..2){
val expected= (i * 10 + j).toDouble()
assertEquals("Error at index [$i, $j]", expected, array[i,j].value)
}
}
}
} }