summaryrefslogtreecommitdiff
path: root/test/test-helpers.hpp
blob: d99e1fa1fc42c3aa69cb2ec9064b4113b2bf3912 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#pragma once

#include <boost/test/tools/context.hpp>
#include <boost/test/tools/interface.hpp>

#define BOOST_CHECK_CLOSE_VEC(a, b) \
	BOOST_TEST_CONTEXT("BOOST_CHECK_CLOSE_VEC(" << a << ", " << b << ")") { \
		BOOST_CHECK_LT(glm::length(a - b), 0.1F); \
	}

#define BOOST_CHECK_BETWEEN(a, b, c) \
	BOOST_TEST_CONTEXT("BOOST_CHECK_BETWEEN(" << a << ", " << b << ", " << c << ")") { \
		BOOST_CHECK_LE(b, a); \
		BOOST_CHECK_GE(c, a); \
	}