summaryrefslogtreecommitdiff
path: root/test/testHelpers.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-04-04 20:06:36 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-04-04 20:06:36 +0100
commit30b027f84772d4b1d18eebd03b83ce3a5966d5fe (patch)
treebf1f424ee3c92516d652934cf502ee06f60c57e5 /test/testHelpers.h
parentSimplify vector addition/subtraction with differnt types (diff)
parentRemove wireframe mode from test renders (diff)
downloadilt-30b027f84772d4b1d18eebd03b83ce3a5966d5fe.tar.bz2
ilt-30b027f84772d4b1d18eebd03b83ce3a5966d5fe.tar.xz
ilt-30b027f84772d4b1d18eebd03b83ce3a5966d5fe.zip
Merge remote-tracking branch 'origin/deform-terrain'
Two related issues remain: * Terrain self shadowing is common and handled poorly * Odd, but mathematically correct patterns/stripes in feature boundaries Neither of these relate directly to deformation.
Diffstat (limited to 'test/testHelpers.h')
-rw-r--r--test/testHelpers.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/testHelpers.h b/test/testHelpers.h
index f2b0901..58e4372 100644
--- a/test/testHelpers.h
+++ b/test/testHelpers.h
@@ -2,11 +2,22 @@
#include <boost/test/tools/context.hpp>
#include <boost/test/tools/interface.hpp>
+#include <filesystem>
+#include <fstream>
#include <iomanip> // IWYU pragma: keep std::setprecision
+#include <jsonParse-persistence.h>
#include <memory>
std::unique_ptr<char, decltype(&free)> uasprintf(const char * fmt, ...) __attribute__((format(printf, 1, 2)));
+template<typename T>
+decltype(auto)
+loadFixtureJson(const std::filesystem::path & path)
+{
+ std::ifstream in {FIXTURESDIR / path};
+ return Persistence::JsonParsePersistence {}.loadState<std::vector<T>>(in);
+}
+
#define BOOST_CHECK_CLOSE_VEC(a_, b_) \
{ \
const auto a {a_}, b {b_}; \