This repository has been archived on 2021-10-31. You can view files and clone it, but cannot push or open issues or pull requests.
sys_prog/chess_paths/tests/test0.c

41 lines
792 B
C

#include <assert.h>
#include "basic_testing.h"
#include "../chess_paths.h"
struct chessboard {
unsigned int C;
unsigned int R;
};
int value_at(const struct chessboard * c, unsigned int column, unsigned int row) {
return column + row * c->C;
}
unsigned int columns(const struct chessboard * c) {
return c->C;
}
unsigned int rows(const struct chessboard * c) {
return c->R;
};
TEST(compilation_and_invocation) {
struct chessboard c = {.C = 10, .R = 10 };
struct piece_position p;
p.piece = PAWN;
p.column = 0;
p.row = 0;
increasing_path_len(&c, &p);
decreasing_path_len(&c, &p);
simple_path_len(&c, &p);
TEST_PASSED;
}
int main() {
RUN_TEST(compilation_and_invocation);
PRINT_TEST_RESULTS;
assert(ALL_TESTS_PASSED);
}