4#include <nlohmann/json.hpp>
5#include <gtest/gtest.h>
12template<
class Proto, const
char * protocolDir>
15 std::filesystem::path unitTestData = getUnitTestData() / protocolDir;
17 std::filesystem::path goldenMaster(std::string_view testStem)
const override {
18 return unitTestData / (std::string { testStem +
".bin" });
22template<
class Proto, const
char * protocolDir>
30 void readProtoTest(PathView testStem,
typename Proto::Version version, T expected)
35 Proto::template Serialise<T>::read(
37 typename Proto::ReadConn {
43 ASSERT_EQ(got, expected);
51 void writeProtoTest(PathView testStem,
typename Proto::Version version,
const T & decoded)
55 Proto::template Serialise<T>::write(
57 typename Proto::WriteConn {
62 return std::move(
to.s);
67#define VERSIONED_CHARACTERIZATION_TEST(FIXTURE, NAME, STEM, VERSION, VALUE) \
68 TEST_F(FIXTURE, NAME ## _read) { \
69 readProtoTest(STEM, VERSION, VALUE); \
71 TEST_F(FIXTURE, NAME ## _write) { \
72 writeProtoTest(STEM, VERSION, VALUE); \
Definition characterization.hh:33
void writeTest(PathView testStem, auto &&test, auto &&readFile2, auto &&writeFile2)
Definition characterization.hh:71
void readTest(PathView testStem, auto &&test)
Definition characterization.hh:48
Definition protocol.hh:14
Definition protocol.hh:24
void writeProtoTest(PathView testStem, typename Proto::Version version, const T &decoded)
Definition protocol.hh:51
void readProtoTest(PathView testStem, typename Proto::Version version, T expected)
Definition protocol.hh:30
std::string std::string_view from
Definition lexer.l:2591
std::string std::string_view std::string_view to
Definition lexer.l:2592
Definition serialise.hh:187
Definition serialise.hh:203