Test case for dialog XMLs in-engine

This commit is contained in:
2023-01-06 01:20:38 -07:00
committed by Celtic Minstrel
parent 6471604fd9
commit ac5cbe3a60
3 changed files with 45 additions and 9 deletions

30
test/dialogs.cpp Normal file
View File

@@ -0,0 +1,30 @@
//
// dialogs.cpp
// BoE
//
// Created by Nat Nelson on 2023-01-06
//
#include "catch.hpp"
#include <boost/filesystem.hpp>
#include "fileio/resmgr/res_dialog.hpp"
#include "dialogxml/dialogs/dialog.hpp"
TEST_CASE("Construct each type of dialog in the engine") {
fs::path dialogsPath = fs::current_path()/".."/"Blades of Exile"/"data"/"dialogs";
fs::directory_iterator it{dialogsPath};
auto end = fs::directory_iterator{};
while (it != end) {
fs::path path = it->path();
std::string filename = path.stem().string();
CAPTURE(filename);
CHECK_NOTHROW({
DialogDefn* defn = load_dialog_defn(path);
cDialog dialog(*defn);
delete defn;
});
++it;
}
}