diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b330c2..64e5e90 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,8 @@ jobs: # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type #run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DTARGET_GROUP=test - run: cmake -B ${{github.workspace}}/build -DTARGET_GROUP=test + run: cmake -B ${{github.workspace}}/build -DTARGET_GROUP=test -DTETRIS_UNIT_TEST_MACRO=ON + # build cmake in build dir with CI unit test flag turned on - name: Build # Build your program with the given configuration diff --git a/README.md b/README.md index 16e8fdf..3d0741e 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,12 @@ The game was branched off to it's own repository because the embedded project so * [ ] fix full lines not being removed * [ ] fix duplicate colors * [ ] fix crash on trying to clear line -* figure out what's causing a bunch of out-of-bounds numbers to show up in row 1 of board +* [ ] figure out what's causing a bunch of out-of-bounds numbers to show up in row 1 of board - i think this is a type issue with uint & int types! +> [!WARNING] +> This project is still in active development, bugs are still being found. When this is no longer the case, this notice will be removed. + ### Project Goals This project has several goals. diff --git a/src/driver_tetris.c b/src/driver_tetris.c index e597bd7..940460e 100644 --- a/src/driver_tetris.c +++ b/src/driver_tetris.c @@ -118,6 +118,7 @@ int main(void) { // load game from disk case 'l': move = T_NONE; + // IMPLEMENT break; default: move = T_NONE; @@ -227,8 +228,8 @@ void print_keypress(enum player_move move) { /** * POSIX sleep for `millis` milliseconds + * `man 2 nanosleep` */ -// `man 2 nanosleep` void sleep_millis(uint16_t millis) { struct timespec ts; ts.tv_sec = 0; diff --git a/test/suite_1.c b/test/suite_1.c index 7d585f6..6aba180 100644 --- a/test/suite_1.c +++ b/test/suite_1.c @@ -225,8 +225,6 @@ void test_checkSpawnNewPiece(void) { tg->last_gravity_tick_usec.tv_sec -= 1; tg->last_gravity_tick_usec.tv_usec -= 100; - // printf("last_grav_tick: %d:%d, tick_rate: %d\n", tg->last_gravity_tick_usec.tv_sec, \ - // tg->last_gravity_tick_usec.tv_usec, tg->gravity_tick_rate_usec); // do gravity should fail since we're at bottom, and // should change active_piece.falling to false diff --git a/tetris/tetris.c b/tetris/tetris.c index 939887b..92c10bc 100644 --- a/tetris/tetris.c +++ b/tetris/tetris.c @@ -470,9 +470,7 @@ bool check_do_piece_gravity(TetrisGame *tg) { void clear_rows(TetrisGame *tg, uint8_t top_row, uint8_t num_rows) { // starting at `row`, go up until you reach cell with value -1 // or the top of the board - //assert(num_rows <= 4 && top_row < TETRIS_ROWS); - assert(num_rows <= 4); - assert(top_row < TETRIS_ROWS); + assert(num_rows <= 4 && top_row < TETRIS_ROWS); // for each col on the board for (int col = 0; col < TETRIS_COLS; col++) {