#include #include "components.hpp" #include #include "json.hpp" #include using json = nlohmann::json; using namespace fuc2; /* * This also tests Mesh by using Model to load them. */ namespace config_tests { void test_json_components() { std::ifstream f{"tests/config.json"}; auto j = json::parse(f); auto mat = j["material_test"].get(); CHECK(mat.ambient.x == 0.1f, "wrong value"); auto light = j["lighting_test"].get(); auto camera = j["camera_test"].get(); auto model = j["model_test"].get(); auto thing = j["thing_test"].get(); } void test_load_json_config() { std::ifstream f{"config.json"}; auto j = json::parse(f); auto scene = j["scene"].get(); } fuc2::Set TESTS{ .name="config", .options={ .fail_fast=false }, .tests={ TEST(test_json_components), TEST(test_load_json_config), } }; }