move test_output to game_private

This commit is contained in:
Théophyl Hoguet committed 2022-03-05 22:24:55 +01:00
1 parent b514e98e70
commit 45b528c6a6
4 files changed
+16 -8

No files matched your search

+7
View File
@@ -12,4 +12,11 @@ void checkPointer(void* p, char* errMessage) {
fprintf(stderr, "%s", errMessage);
exit(EXIT_FAILURE);
}
}
void test_output(int i, int excepted, char* message) {
if (i != excepted) {
fprintf(stderr, message);
exit(EXIT_FAILURE);
}
}
+9
View File
@@ -28,4 +28,13 @@ int max(int a, int b);
*/
void checkPointer(void* p, char* errMessage);
/**
* @brief test if i and excepted are the same else exit the prog with the message
*
* @param i
* @param excepted
* @param message to print in stderr
*/
void test_output(int i, int excepted, char* message);
#endif
-1
View File
@@ -4,7 +4,6 @@
#include "game.h"
#include "game_ext.h"
#include "game_private.h"
#include "game_tools.c"
#include "game_tools.h"
void usage() {
-7
View File
@@ -6,13 +6,6 @@
#define NB_CHAR_HEADER_WITHTOUT_DIMENSIONS 4
void test_output(int i, int excepted, char* message) {
if (i != excepted) {
fprintf(stderr, message);
exit(EXIT_FAILURE);
}
}
game game_load(char* filename) {
checkPointer((void*)filename, "NULL pointer filename on game_load\n");
// ouvrons le fichier