41 static constexpr bool v =
true;
52TYPEDEF_CHECKER(has_type, type);
53TYPEDEF_CHECKER_ANY(any_type, type);
54TYPEDEF_CHECKER_STRICT(exact_type, type);
55MVALUE_CHECKER(true_v, v,
true);
56MVALUE_CHECKER(true_z, z,
true);
57MVALUE_CHECKER(false_v, v,
false);
58MVALUE_CHECKER(one_v, v, 1);
59MVALUE_CHECKER_STRICT(exact_v, v, 1);
73 #define CHECK_2(name, desc, ...) std::cout << std::endl; \
74 std::cout << "One " << (name<One, ##__VA_ARGS__>() ? "has " : "does not have ") << desc << std::endl; \
75 std::cout << "Two " << (name<Two, ##__VA_ARGS__>() ? "has " : "does not have ") << desc << std::endl; \
76 std::cout << "Not " << (name<Not, ##__VA_ARGS__>() ? "has " : "does not have ") << desc << std::endl; \
77 std::cout << "int " << (name<int, ##__VA_ARGS__>() ? "has " : "does not have ") << desc << std::endl
79 std::string sep = std::string(60,
'-');
82 CHECK_2(any_type,
"typedef type");
83 CHECK_2(has_type,
"typedef type convertible to long",
long);
84 CHECK_2(exact_type,
"typedef type = int",
int);
85 CHECK_2(exact_type,
"typedef type = long",
long);
88 CHECK_2(true_v,
"var v with value equal to true");
89 CHECK_2(true_z,
"var z with value equal to true");
90 CHECK_2(false_v,
"var v with value equal to false");
91 CHECK_2(one_v,
"var v with value equal to 1");
92 CHECK_2(exact_v,
"var v with value equal to 1 of type int");
97 CHECK_2(has_x,
"var x of type convertible to long",
long);
98 CHECK_2(exact_x,
"var x of type int",
int);
99 CHECK_2(exact_x,
"var x of type long",
long);
103 CHECK_2(has_get,
"get() with return type covertible to long");
104 CHECK_2(has_add,
"add() accepting two ints and returning ~ long");
106 CHECK_2(long_get,
"long get()");
#define METHOD_CHECKER_STRICT_RET(name, fn, ret, args)
Checker for member function with exact retutn type and accepting given arguments.
Entry * get(const EUI48 &addr, const std::string &name, AddressNameEntryMatchFunc m) noexcept
Returns a matching BTSecurityRegistry::Entry with the given addr and/or name.
__pack(...): Produces MSVC, clang and gcc compatible lead-in and -out macros.
type add(type x_, type y_)
#define CHECK_2(name, desc,...)
MTYPE_CHECKER_ANY(any_x, x)
TEST_CASE("01 Type Traits Queries")
METHOD_CHECKER_ANY(any_get, get,())
MTYPE_CHECKER_STRICT(exact_x, x)
METHOD_CHECKER(has_get, get, long,())