micro-test-plus 6.0.0
µTest++ Testing Framework
Loading...
Searching...
No Matches
micro_os_plus::micro_test_plus::detail::suspicious_condition Concept Reference

Concept satisfied when a type is contextually convertible to bool, but is most likely not a condition. More...

#include <extension.h>

Concept definition

template<class T>
concept suspicious_condition = std::is_array_v<T> or std::is_function_v<T>
or std::is_member_pointer_v<T>
or (std::is_pointer_v<T>
and (std::is_function_v<std::remove_pointer_t<T>>
or std::is_same_v<
std::remove_cv_t<std::remove_pointer_t<T>>, char>
or std::is_same_v<
std::remove_cv_t<std::remove_pointer_t<T>>, wchar_t>
or std::is_same_v<
std::remove_cv_t<std::remove_pointer_t<T>>, char8_t>
or std::is_same_v<
std::remove_cv_t<std::remove_pointer_t<T>>, char16_t>
or std::is_same_v<
std::remove_cv_t<std::remove_pointer_t<T>>, char32_t>))
Concept satisfied when a type is contextually convertible to bool, but is most likely not a condition...
Definition extension.h:239

Detailed Description

Template Parameters
TThe type to be checked.

The suspicious_condition concept is satisfied by the arrays (including the string literals), the functions, the pointers to functions and to members, and the pointers to the character types. All of them are contextually convertible to bool, so, when passed to expect() or require(), the check silently passes, usually because the description was written instead of the condition, or because a function name was written without the call. The pointers to other object types are not included, since checking a pointer for null is a legitimate use.

Definition at line 238 of file extension.h.