Skip to content

Commit

Permalink
another test
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGAzed committed Jun 23, 2024
1 parent 5b8e20f commit 476a838
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
20 changes: 0 additions & 20 deletions program/source/structures/concrete/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ void _kakuro_alloc(Kakuro * board, FILE * kakuro_file) {
}

void _kakuro_setup(Kakuro * board) {
assert(board && "KAKURO POINTER IS NULL");

lookup_t index = 0;
for (size_t r = 0; r < board->game.size[ROW]; r++) {
for (size_t c = 0; c < board->game.size[COLUMN]; c++) {
Expand All @@ -177,23 +175,11 @@ void _kakuro_setup(Kakuro * board) {
}

void _setup_coords(Kakuro * board, ksize_t row, ksize_t col, ksize_t index) {
assert(row < board->game.size[ROW] && "ROW IS OUT OF BOUNDS");
assert(col < board->game.size[COLUMN] && "COLUMN IS OUT OF BOUNDS");
assert(index < board->game.empty_count && "INDEX IS OUT OF BOUNDS");
assert(board->coords[ROW] && "LOOKUP IS NULL");
assert(board->coords[COLUMN] && "LOOKUP IS NULL");

board->coords[ROW][index] = row;
board->coords[COLUMN][index] = col;
}

void _setup_blocks(Kakuro * board, ksize_t row, ksize_t col, ksize_t index) {
assert(row < board->game.size[ROW] && "ROW IS OUT OF BOUNDS");
assert(col < board->game.size[COLUMN] && "COLUMN IS OUT OF BOUNDS");
assert(index < board->game.empty_count && "INDEX IS OUT OF BOUNDS");
assert(board->grid && "LOOKUP POINTER IS NULL");
assert(board->blocks && "LOOKUP POINTER IS NULL");

ksize_t r = row, c = col;
if (col && board->grid[row][col - 1] != -1 && board->blocks[ROW][board->grid[row][col - 1]]) {
board->blocks[ROW][index] = board->blocks[ROW][board->grid[row][col - 1]];
Expand All @@ -213,12 +199,6 @@ void _setup_blocks(Kakuro * board, ksize_t row, ksize_t col, ksize_t index) {
}

void _setup_sums(Kakuro * board, ksize_t row, ksize_t col, ksize_t index) {
assert(row < board->game.size[ROW] && "ROW IS OUT OF BOUNDS");
assert(col < board->game.size[COLUMN] && "COLUMN IS OUT OF BOUNDS");
assert(index < board->game.empty_count && "INDEX IS OUT OF BOUNDS");
assert(board->grid && "LOOKUP POINTER IS NULL");
assert(board->sums && "LOOKUP POINTER IS NULL");

ksize_t r = row, c = col;
if (col && board->grid[row][col - 1] != -1 && board->sums[ROW][board->grid[row][col - 1]]) {
board->sums[ROW][index] = board->sums[ROW][board->grid[row][col - 1]];
Expand Down
8 changes: 8 additions & 0 deletions test/blackbox/suites/easy/easy_unset.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ TEST easy_unset_one(void) {

FILE * fp = fopen(get_settings_singleton()->filepath, "rb");
ASSERTm("COULDN'T OPEN FILE", fp);

char c;
do {
c = fgetc(fp);
printf ("%02x\n", c);
} while (!feof(fp));
fflush(stdout);
rewind(fp);

Kakuro board = init_kakuro(fp);
fclose(fp);
Expand Down

0 comments on commit 476a838

Please sign in to comment.