13#include <boost/test/unit_test.hpp>
ParseNameStatus parse_name(const uint8_t **inpos, const uint8_t *inend, const uint8_t *inbuf, char *buf, size_t bufsize)
constexpr int MAX_LABEL_LENGTH
constexpr int MAX_QUERY_NAME_LENGTH
constexpr int MAX_QUERY_NAME_BUFFER_LENGTH
static std::vector< uint8_t > CreateDNSQuestionNameField(const std::string &queryName)
Implement std::hash so RCUPtr can be used as a key for maps or sets.
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
std::ostream & operator<<(std::ostream &os, const ParseNameStatus &status)
static void CheckParseName(const std::string &queryName)
BOOST_AUTO_TEST_CASE(parse_name_simple_tests)
static void CheckParseNameError(const std::string &queryName, const ParseNameStatus expectedError, const size_t &outputBufferSize=MAX_QUERY_NAME_BUFFER_LENGTH)
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
constexpr std::underlying_type< E >::type to_integral(E e)