pfor/tests/common.h

31 lines
677 B
C++

#ifndef CATCH_COMMON_H
#define CATCH_COMMON_H
#include <pfor/mp/meta.h>
#include <pfor/mp/pack.h>
#include <pfor/index/index.h>
#define TEST(T, ...) do { \
decltype(__VA_ARGS__) r_ = __VA_ARGS__; \
T(r_); \
} while(false)
#define TEST_IF(T, O, R, ...) do { \
decltype(__VA_ARGS__) r_ = __VA_ARGS__; \
T(r_ O R); \
} while(false)
#define V(T) std::declval<T>()
template<typename T, typename U>
constexpr bool is_same_v = std::is_same<T, U>::value;
template<std::size_t... Is>
using UIntsToPack = pfor::Pack<pfor::UIntToType<Is>...>;
template<std::size_t V>
constexpr auto _ = pfor::ctv<V>;
#endif