Update test coverage

This commit is contained in:
2023-06-30 21:41:03 -04:00
parent 96fec9d7c2
commit 7efca4a154
9 changed files with 88 additions and 56 deletions

View File

@@ -1,7 +1,7 @@
//Matrix/src/test/java/com/mattrixwv/matrix/TestBigBigIntegerMatrix.java
//Mattrixwv
// Created: 02-10-22
//Modified: 04-13-23
//Modified: 06-30-23
package com.mattrixwv.matrix;
@@ -1861,19 +1861,19 @@ public class TestBigIntegerMatrix{
@Test
public void testLaplaceExpansionHelper(){
BigIntegerMatrixPublic matrix = new BigIntegerMatrixPublic();
BigIntegerMatrix matrix = new BigIntegerMatrix();
matrix.addRow(grid2[0]);
assertThrows(InvalidGeometryException.class, () -> {
matrix.laplaceExpansionHelper(0, 0);
});
BigIntegerMatrixPublic matrix2 = new BigIntegerMatrixPublic();
BigIntegerMatrix matrix2 = new BigIntegerMatrix();
matrix2.setGrid(grid1);
assertThrows(InvalidGeometryException.class, () -> {
matrix2.laplaceExpansionHelper(0, 0);
});
BigIntegerMatrixPublic matrix3 = new BigIntegerMatrixPublic();
BigIntegerMatrix matrix3 = new BigIntegerMatrix();
matrix3.setGrid(grid2);
assertThrows(InvalidCoordinatesException.class, () -> {
matrix3.laplaceExpansionHelper(-1, 0);
@@ -1887,9 +1887,16 @@ public class TestBigIntegerMatrix{
assertThrows(InvalidCoordinatesException.class, () -> {
matrix3.laplaceExpansionHelper(0, 2);
});
}
private class BigIntegerMatrixPublic extends BigIntegerMatrix{
BigIntegerMatrix matrix4 = new BigIntegerMatrix();
matrix4.addCol(grid2[0]);
assertThrows(InvalidGeometryException.class, () -> {
matrix4.laplaceExpansionHelper(0, 0);
});
matrix4.addCol(grid2[1]);
matrix4.addCol(grid2[0]);
assertThrows(InvalidGeometryException.class, () -> {
matrix4.laplaceExpansionHelper(0, 0);
});
}
}

View File

@@ -1,7 +1,7 @@
//Matrix/src/test/java/com/mattrixwv/matrix/TestDoubleMatrix.java
//Mattrixwv
// Created: 02-07-22
//Modified: 04-13-23
//Modified: 06-30-23
package com.mattrixwv.matrix;
@@ -1853,19 +1853,19 @@ public class TestDoubleMatrix{
@Test
public void testLaplaceExpansionHelper(){
DoubleMatrixPublic matrix = new DoubleMatrixPublic();
DoubleMatrix matrix = new DoubleMatrix();
matrix.addRow(grid2[0]);
assertThrows(InvalidGeometryException.class, () -> {
matrix.laplaceExpansionHelper(0, 0);
});
DoubleMatrixPublic matrix2 = new DoubleMatrixPublic();
DoubleMatrix matrix2 = new DoubleMatrix();
matrix2.setGrid(grid1);
assertThrows(InvalidGeometryException.class, () -> {
matrix2.laplaceExpansionHelper(0, 0);
});
DoubleMatrixPublic matrix3 = new DoubleMatrixPublic();
DoubleMatrix matrix3 = new DoubleMatrix();
matrix3.setGrid(grid2);
assertThrows(InvalidCoordinatesException.class, () -> {
matrix3.laplaceExpansionHelper(-1, 0);
@@ -1879,9 +1879,16 @@ public class TestDoubleMatrix{
assertThrows(InvalidCoordinatesException.class, () -> {
matrix3.laplaceExpansionHelper(0, 2);
});
}
private class DoubleMatrixPublic extends DoubleMatrix{
DoubleMatrix matrix4 = new DoubleMatrix();
matrix4.addCol(grid2[0]);
assertThrows(InvalidGeometryException.class, () -> {
matrix4.laplaceExpansionHelper(0, 0);
});
matrix4.addCol(grid2[1]);
matrix4.addCol(grid2[0]);
assertThrows(InvalidGeometryException.class, () -> {
matrix4.laplaceExpansionHelper(0, 0);
});
}
}

View File

@@ -1,7 +1,7 @@
//Matrix/src/test/java/com/mattrixwv/matrix/TestIntegerMatrix.java
//Mattrixwv
// Created: 02-01-22
//Modified: 04-13-23
//Modified: 06-30-23
package com.mattrixwv.matrix;
@@ -1852,19 +1852,19 @@ public class TestIntegerMatrix{
@Test
public void testLaplaceExpansionHelper(){
IntegerMatrixPublic matrix = new IntegerMatrixPublic();
IntegerMatrix matrix = new IntegerMatrix();
matrix.addRow(grid2[0]);
assertThrows(InvalidGeometryException.class, () -> {
matrix.laplaceExpansionHelper(0, 0);
});
IntegerMatrixPublic matrix2 = new IntegerMatrixPublic();
IntegerMatrix matrix2 = new IntegerMatrix();
matrix2.setGrid(grid1);
assertThrows(InvalidGeometryException.class, () -> {
matrix2.laplaceExpansionHelper(0, 0);
});
IntegerMatrixPublic matrix3 = new IntegerMatrixPublic();
IntegerMatrix matrix3 = new IntegerMatrix();
matrix3.setGrid(grid2);
assertThrows(InvalidCoordinatesException.class, () -> {
matrix3.laplaceExpansionHelper(-1, 0);
@@ -1878,9 +1878,16 @@ public class TestIntegerMatrix{
assertThrows(InvalidCoordinatesException.class, () -> {
matrix3.laplaceExpansionHelper(0, 2);
});
}
private class IntegerMatrixPublic extends IntegerMatrix{
IntegerMatrix matrix4 = new IntegerMatrix();
matrix4.addCol(grid2[0]);
assertThrows(InvalidGeometryException.class, () -> {
matrix4.laplaceExpansionHelper(0, 0);
});
matrix4.addCol(grid2[1]);
matrix4.addCol(grid2[0]);
assertThrows(InvalidGeometryException.class, () -> {
matrix4.laplaceExpansionHelper(0, 0);
});
}
}

View File

@@ -1852,19 +1852,19 @@ public class TestLongMatrix{
@Test
public void testLaplaceExpansionHelper(){
LongMatrixPublic matrix = new LongMatrixPublic();
LongMatrix matrix = new LongMatrix();
matrix.addRow(grid2[0]);
assertThrows(InvalidGeometryException.class, () -> {
matrix.laplaceExpansionHelper(0, 0);
});
LongMatrixPublic matrix2 = new LongMatrixPublic();
LongMatrix matrix2 = new LongMatrix();
matrix2.setGrid(grid1);
assertThrows(InvalidGeometryException.class, () -> {
matrix2.laplaceExpansionHelper(0, 0);
});
LongMatrixPublic matrix3 = new LongMatrixPublic();
LongMatrix matrix3 = new LongMatrix();
matrix3.setGrid(grid2);
assertThrows(InvalidCoordinatesException.class, () -> {
matrix3.laplaceExpansionHelper(-1, 0);
@@ -1878,9 +1878,16 @@ public class TestLongMatrix{
assertThrows(InvalidCoordinatesException.class, () -> {
matrix3.laplaceExpansionHelper(0, 2);
});
}
private class LongMatrixPublic extends LongMatrix{
LongMatrix matrix4 = new LongMatrix();
matrix4.addCol(grid2[0]);
assertThrows(InvalidGeometryException.class, () -> {
matrix4.laplaceExpansionHelper(0, 0);
});
matrix4.addCol(grid2[1]);
matrix4.addCol(grid2[0]);
assertThrows(InvalidGeometryException.class, () -> {
matrix4.laplaceExpansionHelper(0, 0);
});
}
}

View File

@@ -1840,19 +1840,19 @@ public class TestModMatrix{
@Test
public void testLaplaceExpansionHelper(){
ModMatrixPublic matrix = new ModMatrixPublic();
ModMatrix matrix = new ModMatrix(Integer.MAX_VALUE);
matrix.addRow(grid2[0]);
assertThrows(InvalidGeometryException.class, () -> {
matrix.laplaceExpansionHelper(0, 0);
});
ModMatrixPublic matrix2 = new ModMatrixPublic();
ModMatrix matrix2 = new ModMatrix(Integer.MAX_VALUE);
matrix2.setGrid(grid1);
assertThrows(InvalidGeometryException.class, () -> {
matrix2.laplaceExpansionHelper(0, 0);
});
ModMatrixPublic matrix3 = new ModMatrixPublic();
ModMatrix matrix3 = new ModMatrix(Integer.MAX_VALUE);
matrix3.setGrid(grid2);
assertThrows(InvalidCoordinatesException.class, () -> {
matrix3.laplaceExpansionHelper(-1, 0);
@@ -1866,12 +1866,16 @@ public class TestModMatrix{
assertThrows(InvalidCoordinatesException.class, () -> {
matrix3.laplaceExpansionHelper(0, 2);
});
}
private class ModMatrixPublic extends ModMatrix{
public ModMatrixPublic(){
super(Integer.MAX_VALUE);
}
ModMatrix matrix4 = new ModMatrix(Integer.MAX_VALUE);
matrix4.addCol(grid2[0]);
assertThrows(InvalidGeometryException.class, () -> {
matrix4.laplaceExpansionHelper(0, 0);
});
matrix4.addCol(grid2[1]);
matrix4.addCol(grid2[0]);
assertThrows(InvalidGeometryException.class, () -> {
matrix4.laplaceExpansionHelper(0, 0);
});
}
}