xtd
0.2.0
Loading...
Searching...
No Matches
◆
is_not_null()
[7/24]
template<typename optional_t >
static void xtd::tunit::valid::is_not_null
(
const std::optional< optional_t > &
opt
,
const
xtd::string
&
message
)
inline
static
Validates that the optional is not std::nullopt.
Parameters
opt
The optional to check is std::nullopt.
message
A user message to display if the assertion fails. This message can be seen in the unit test results.
Examples
std::optional<std::string> s1 =
"Anything"
;
std::optional<std::string> s2;
xtd::tunit::valid::is_not_null
(s1,
"User message..."
);
// test ok.
xtd::tunit::valid::is_not_null
(s2,
"User message..."
);
// test fails.
xtd::tunit::valid::is_not_null
static void is_not_null(const pointer_t *pointer)
Validates that the pointer is not null.
Definition
valid.h:1348
xtd
tunit
valid
Generated on Sat Sep 14 2024 21:25:32 for xtd by
Gammasoft
. All rights reserved.