last functions + tests fail
This commit is contained in:
1 parent
ed19ad91a2
commit
3839e59097
3 files changed
+33
-3
No files matched your search
@@ -62,6 +62,9 @@ add_test(test_nnunes_game_get_flags ./game_test_nnunes game_get_flags)
|
||||
add_test(test_nnunes_game_is_marked ./game_test_nnunes game_is_marked)
|
||||
add_test(test_nnunes_game_is_lighted ./game_test_nnunes game_is_lighted)
|
||||
add_test(test_nnunes_game_has_error ./game_test_nnunes game_has_error)
|
||||
add_test(test_nnunes_game_nb_rows ./game_test_nnunes game_nb_rows)
|
||||
add_test(test_nnunes_game_nb_cols ./game_test_nnunes game_nb_cols)
|
||||
add_test(test_nnunes_game_is_wrapping ./game_test_nnunes game_is_wrapping)
|
||||
|
||||
#Tests HISTORY
|
||||
add_test(test_history_history_alloc ./history_test history_alloc)
|
||||
|
||||
+3
-3
@@ -44,15 +44,15 @@ game game_new_empty_ext(uint nb_rows, uint nb_cols, bool wrapping) {
|
||||
}
|
||||
|
||||
uint game_nb_rows(cgame g) {
|
||||
return 0;
|
||||
return g->height;
|
||||
}
|
||||
|
||||
uint game_nb_cols(cgame g) {
|
||||
return 0;
|
||||
return g->width;
|
||||
}
|
||||
|
||||
bool game_is_wrapping(cgame g) {
|
||||
return false;
|
||||
return g->wrapping;
|
||||
}
|
||||
|
||||
void game_undo(game g) {
|
||||
|
||||
@@ -357,6 +357,33 @@ bool test_game_has_error(void) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* ************** game_nb_rows ************** */
|
||||
bool test_game_nb_rows(void) {
|
||||
game g = game_new_empty();
|
||||
if (game_nb_rows(g) != g->height){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* ************** game_nb_cols ************** */
|
||||
bool test_game_nb_cols(void) {
|
||||
game g = game_new_empty();
|
||||
if (game_nb_cols(g) != g->width){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* ************** game_is_wrapping ************** */
|
||||
bool test_game_is_wrapping(void) {
|
||||
game g = game_new_empty();
|
||||
if (game_is_wrapping(g) != g->wrapping){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
if (argc != 2) {
|
||||
usage(argc, argv);
|
||||
|
||||
Reference in new issue
Block a user