Skip to content
Snippets Groups Projects
Commit 931797e7 authored by ERKEN EFE's avatar ERKEN EFE
Browse files

:sparkles: NEW: Add test.c to test functions

Added testing file to test each project function before release.
parent f0a03af8
Branches
Tags
No related merge requests found
test.c 0 → 100644
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include "grid.h"
int main01()
{
// Test des fonctions creer_grid() et free_grid() dans grid.c
int row = 11;
int column = 26;
grid* level = creer_grid(row, column);
level->game_grid[0][0] = '#';
level->game_grid[3][1] = '@';
printf("Size of structure is %d\n", (int)sizeof(*level));
printf("Number of lines is %d\n", level->row_number);
printf("Number of columns is %d\n", level->column_number);
printf("Grid block at coordinates (0,0) %c\n", level->game_grid[0][0]);
printf("Grid block at coordinates (1,3) %c\n", level->game_grid[3][1]);
free_grid(level);
return 0;
}
int main() {
// Test de la fonction init_level() dans grid.c
grid* level = init_level("level1.txt");
printf("Number of lines is %d\n", level->row_number);
printf("Number of columns is %d\n", level->column_number);
printf("Grid block at coordinates (12,5) %c\n", level->game_grid[5][12]);
printf("Grid block at coordinates (7,2) %c\n", level->game_grid[2][7]);
free_grid(level);
return 0;
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment