More testing improvements.

This commit is contained in:
Zed A. Shaw 2025-02-21 13:21:13 -05:00
parent 84fff71344
commit d0a6a92bc8
3 changed files with 20 additions and 92 deletions

View file

@ -2,16 +2,31 @@
#include <fmt/core.h>
#include <string>
#include "textures.hpp"
#include "levelmanager.hpp"
using namespace fmt;
TEST_CASE("test texture management", "[textures]") {
textures::init();
auto spider = textures::get("hairy_spider");
REQUIRE(spider.sprite != nullptr);
REQUIRE(spider.texture != nullptr);
auto image = textures::load_image("assets/hairy_spider-256.png");
auto img_ptr = textures::get_surface(0);
REQUIRE(img_ptr != nullptr);
auto floor_ptr = textures::get_floor();
REQUIRE(floor_ptr != nullptr);
auto ceiling_ptr = textures::get_ceiling();
REQUIRE(ceiling_ptr != nullptr);
LevelManager levels;
GameLevel level = levels.current();
auto& tiles = level.map->tiles();
auto map = textures::convert_char_to_texture(tiles.$tile_ids);
REQUIRE(matrix::width(map) == matrix::width(tiles.$tile_ids));
REQUIRE(matrix::height(map) == matrix::height(tiles.$tile_ids));
}