dos-vga-arena-shooter-game/const_test.c

29 lines
761 B
C
Raw Normal View History

2024-03-01 12:55:01 +00:00
#include "cutest-1.5/CuTest.h"
#include "const.h"
#include <stdio.h>
void TestBuildDifficultyBands(CuTest *tc) {
2024-03-04 22:38:03 +00:00
2024-03-01 12:55:01 +00:00
buildDifficultyBands();
2024-03-04 22:38:03 +00:00
CuAssertIntEquals(tc, 20, difficultyBands[0]);
CuAssertIntEquals(tc, 41, difficultyBands[1]);
CuAssertIntEquals(tc, 3095, difficultyBands[MAX_DIFFICULTY - 1]);
2024-03-01 12:55:01 +00:00
}
void TestBuildHitPointRanges(CuTest *tc) {
buildHitPointRages();
CuAssertIntEquals(tc, 1, hitPointRanges[0][0]);
CuAssertIntEquals(tc, 1, hitPointRanges[1][0]);
CuAssertIntEquals(tc, 2, hitPointRanges[4][0]);
CuAssertIntEquals(tc, 1, hitPointRanges[4][3]);
2024-03-01 12:55:01 +00:00
}
CuSuite *ConstGetSuite() {
CuSuite *suite = CuSuiteNew();
SUITE_ADD_TEST(suite, TestBuildDifficultyBands);
SUITE_ADD_TEST(suite, TestBuildHitPointRanges);
return suite;
}