forked from 61c-teach/fa22-proj1-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
asserts.h
28 lines (23 loc) · 985 Bytes
/
asserts.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef _ASSERTS_H
#define _ASSERTS_H
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "state.h"
extern const unsigned int DEFAULT_BOARD_WIDTH;
extern const unsigned int DEFAULT_BOARD_HEIGHT;
bool assert_true(char* msg, bool actual);
bool assert_false(char* msg, bool actual);
bool assert_equals_bool(char* msg, bool expected, bool actual);
bool assert_equals_char(char* msg, char expected, char actual);
bool assert_equals_int(char* msg, int expected, int actual);
bool assert_equals_unsigned_int(char* msg, unsigned int expected, unsigned int actual);
bool assert_load_equals(char* filename, char* expected);
bool assert_map_equals(game_state_t* state, unsigned int row, unsigned int col, char expected);
bool assert_state_equals(game_state_t* expected, game_state_t* actual);
bool assert_file_size(char* fd, size_t expected_file_size);
void init_colors();
bool test_and_print(char* label, bool (*run_test)());
#endif