Now all of the old LevelManager code is gone. Next phase is to rename the Game:: to something better then test the shit out of it.
This commit is contained in:
parent
a83ee77eea
commit
c46927ea10
7 changed files with 91 additions and 126 deletions
|
@ -16,8 +16,6 @@ json load_test_data(const string &fname) {
|
|||
}
|
||||
|
||||
TEST_CASE("camera control", "[map]") {
|
||||
textures::init();
|
||||
components::init();
|
||||
Game::init();
|
||||
|
||||
auto& level = Game::current();
|
||||
|
@ -36,11 +34,8 @@ TEST_CASE("camera control", "[map]") {
|
|||
}
|
||||
|
||||
TEST_CASE("map placement test", "[map-fail]") {
|
||||
textures::init();
|
||||
components::init();
|
||||
Game::init();
|
||||
|
||||
|
||||
for(int i = 0; i < 5; i++) {
|
||||
auto& level = Game::create_level();
|
||||
|
||||
|
@ -84,8 +79,6 @@ TEST_CASE("dijkstra algo test", "[map]") {
|
|||
}
|
||||
|
||||
TEST_CASE("map image test", "[map]") {
|
||||
components::init();
|
||||
textures::init();
|
||||
Game::init();
|
||||
|
||||
auto& level = Game::current();
|
||||
|
|
|
@ -20,7 +20,7 @@ std::shared_ptr<Map> make_map() {
|
|||
return Game::current().map;
|
||||
}
|
||||
|
||||
TEST_CASE("basic matrix iterator", "[matrix:basic]") {
|
||||
TEST_CASE("basic matrix iterator", "[matrix]") {
|
||||
std::ifstream infile("./tests/dijkstra.json");
|
||||
json data = json::parse(infile);
|
||||
auto test = data[0];
|
||||
|
@ -107,7 +107,7 @@ TEST_CASE("thrash matrix iterators", "[matrix]") {
|
|||
}
|
||||
}
|
||||
|
||||
TEST_CASE("thrash box distance iterators", "[matrix:distance]") {
|
||||
TEST_CASE("thrash box distance iterators", "[matrix]") {
|
||||
size_t width = Random::uniform<size_t>(10, 21);
|
||||
size_t height = Random::uniform<size_t>(10, 25);
|
||||
|
||||
|
@ -159,7 +159,7 @@ TEST_CASE("thrash box iterators", "[matrix]") {
|
|||
}
|
||||
}
|
||||
|
||||
TEST_CASE("thrash compass iterators", "[matrix:compass]") {
|
||||
TEST_CASE("thrash compass iterators", "[matrix]") {
|
||||
for(int count = 0; count < 5; count++) {
|
||||
size_t width = Random::uniform<size_t>(1, 25);
|
||||
size_t height = Random::uniform<size_t>(1, 33);
|
||||
|
@ -189,7 +189,7 @@ TEST_CASE("thrash compass iterators", "[matrix:compass]") {
|
|||
}
|
||||
}
|
||||
|
||||
TEST_CASE("prototype line algorithm", "[matrix:line]") {
|
||||
TEST_CASE("prototype line algorithm", "[matrix]") {
|
||||
size_t width = Random::uniform<size_t>(10, 12);
|
||||
size_t height = Random::uniform<size_t>(10, 15);
|
||||
Map map(width,height);
|
||||
|
@ -225,7 +225,7 @@ TEST_CASE("prototype line algorithm", "[matrix:line]") {
|
|||
}
|
||||
}
|
||||
|
||||
TEST_CASE("prototype circle algorithm", "[matrix:circle]") {
|
||||
TEST_CASE("prototype circle algorithm", "[matrix]") {
|
||||
for(int count = 0; count < 5; count++) {
|
||||
size_t width = Random::uniform<size_t>(10, 13);
|
||||
size_t height = Random::uniform<size_t>(10, 15);
|
||||
|
@ -256,8 +256,10 @@ TEST_CASE("prototype circle algorithm", "[matrix:circle]") {
|
|||
}
|
||||
}
|
||||
|
||||
TEST_CASE("viewport iterator", "[matrix:viewport]") {
|
||||
TEST_CASE("viewport iterator", "[matrix]") {
|
||||
components::init();
|
||||
textures::init();
|
||||
Game::init();
|
||||
size_t width = Random::uniform<size_t>(20, 22);
|
||||
size_t height = Random::uniform<size_t>(21, 25);
|
||||
shared_ptr<Map> map = make_map();
|
||||
|
@ -280,7 +282,7 @@ TEST_CASE("viewport iterator", "[matrix:viewport]") {
|
|||
}
|
||||
}
|
||||
|
||||
TEST_CASE("random rectangle", "[matrix:rando_rect]") {
|
||||
TEST_CASE("random rectangle", "[matrix]") {
|
||||
components::init();
|
||||
for(int i = 0; i < 5; i++) {
|
||||
shared_ptr<Map> map = make_map();
|
||||
|
@ -305,7 +307,7 @@ TEST_CASE("random rectangle", "[matrix:rando_rect]") {
|
|||
}
|
||||
}
|
||||
|
||||
TEST_CASE("standard rectangle", "[matrix:rectangle]") {
|
||||
TEST_CASE("standard rectangle", "[matrix]") {
|
||||
components::init();
|
||||
for(int i = 0; i < 5; i++) {
|
||||
shared_ptr<Map> map = make_map();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue