Skip to content

Commit a5d2cf7

Browse files
committed
Fix
1 parent 8c3f9a3 commit a5d2cf7

File tree

1 file changed

+4
-36
lines changed

1 file changed

+4
-36
lines changed

src/test/java/com/thealgorithms/dynamicprogramming/BoundaryFillTest.java

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,7 @@ public class BoundaryFillTest {
1212

1313
@BeforeEach
1414
void setUp() {
15-
image = new int[][] {
16-
{0, 0, 0, 0, 0, 0, 0},
17-
{0, 3, 3, 3, 3, 0, 0},
18-
{0, 3, 0, 0, 3, 0, 0},
19-
{0, 3, 0, 0, 3, 3, 3},
20-
{0, 3, 3, 3, 0, 0, 3},
21-
{0, 0, 0, 3, 0, 0, 3},
22-
{0, 0, 0, 3, 3, 3, 3}
23-
};
15+
image = new int[][] {{0, 0, 0, 0, 0, 0, 0}, {0, 3, 3, 3, 3, 0, 0}, {0, 3, 0, 0, 3, 0, 0}, {0, 3, 0, 0, 3, 3, 3}, {0, 3, 3, 3, 0, 0, 3}, {0, 0, 0, 3, 0, 0, 3}, {0, 0, 0, 3, 3, 3, 3}};
2416
}
2517

2618
@Test
@@ -43,15 +35,7 @@ void testPutPixel() {
4335
void testBoundaryFill() {
4436
BoundaryFill.boundaryFill(image, 2, 2, 5, 3);
4537

46-
int[][] expectedImage = {
47-
{0, 0, 0, 0, 0, 0, 0},
48-
{0, 3, 3, 3, 3, 0, 0},
49-
{0, 3, 5, 5, 3, 0, 0},
50-
{0, 3, 5, 5, 3, 3, 3},
51-
{0, 3, 3, 3, 5, 5, 3},
52-
{0, 0, 0, 3, 5, 5, 3},
53-
{0, 0, 0, 3, 3, 3, 3}
54-
};
38+
int[][] expectedImage = {{0, 0, 0, 0, 0, 0, 0}, {0, 3, 3, 3, 3, 0, 0}, {0, 3, 5, 5, 3, 0, 0}, {0, 3, 5, 5, 3, 3, 3}, {0, 3, 3, 3, 5, 5, 3}, {0, 0, 0, 3, 5, 5, 3}, {0, 0, 0, 3, 3, 3, 3}};
5539

5640
for (int i = 0; i < image.length; i++) {
5741
assertArrayEquals(expectedImage[i], image[i]);
@@ -62,15 +46,7 @@ void testBoundaryFill() {
6246
void testBoundaryFillEdgeCase() {
6347
BoundaryFill.boundaryFill(image, 1, 1, 3, 3);
6448

65-
int[][] expectedImage = {
66-
{0, 0, 0, 0, 0, 0, 0},
67-
{0, 3, 3, 3, 3, 0, 0},
68-
{0, 3, 0, 0, 3, 0, 0},
69-
{0, 3, 0, 0, 3, 3, 3},
70-
{0, 3, 3, 3, 0, 0, 3},
71-
{0, 0, 0, 3, 0, 0, 3},
72-
{0, 0, 0, 3, 3, 3, 3}
73-
};
49+
int[][] expectedImage = {{0, 0, 0, 0, 0, 0, 0}, {0, 3, 3, 3, 3, 0, 0}, {0, 3, 0, 0, 3, 0, 0}, {0, 3, 0, 0, 3, 3, 3}, {0, 3, 3, 3, 0, 0, 3}, {0, 0, 0, 3, 0, 0, 3}, {0, 0, 0, 3, 3, 3, 3}};
7450

7551
for (int i = 0; i < image.length; i++) {
7652
assertArrayEquals(expectedImage[i], image[i]);
@@ -81,15 +57,7 @@ void testBoundaryFillEdgeCase() {
8157
void testBoundaryFillInvalidCoordinates() {
8258
BoundaryFill.boundaryFill(image, -1, -1, 5, 3);
8359

84-
int[][] expectedImage = {
85-
{0, 0, 0, 0, 0, 0, 0},
86-
{0, 3, 3, 3, 3, 0, 0},
87-
{0, 3, 0, 0, 3, 0, 0},
88-
{0, 3, 0, 0, 3, 3, 3},
89-
{0, 3, 3, 3, 0, 0, 3},
90-
{0, 0, 0, 3, 0, 0, 3},
91-
{0, 0, 0, 3, 3, 3, 3}
92-
};
60+
int[][] expectedImage = {{0, 0, 0, 0, 0, 0, 0}, {0, 3, 3, 3, 3, 0, 0}, {0, 3, 0, 0, 3, 0, 0}, {0, 3, 0, 0, 3, 3, 3}, {0, 3, 3, 3, 0, 0, 3}, {0, 0, 0, 3, 0, 0, 3}, {0, 0, 0, 3, 3, 3, 3}};
9361

9462
for (int i = 0; i < image.length; i++) {
9563
assertArrayEquals(expectedImage[i], image[i]);

0 commit comments

Comments
 (0)