xtd
0.2.0
Loading...
Searching...
No Matches
◆
is_not_null()
[19/24]
template<typename pointer_t >
static void xtd::tunit::valid::is_not_null
(
const
xtd::wptr
< pointer_t > &
pointer
,
const
xtd::string
&
message
)
inline
static
Validates that the pointer is not null.
Parameters
pointer
The pointer to check is null.
message
A user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Always true, a
xtd::wptr
can't be equal to nullptr by construction or assignation.
Examples
xtd::sptr<std::string>
s
= xtd::new_sptr<std::string>(
"Anything"
);
xtd::wptr<std::string>
s1 =
s
;
xtd::wptr<std::string>
s2;
xtd::tunit::valid::is_not_null
(s1,
"User message..."
);
// test ok.
xtd::tunit::valid::is_not_null
(s2,
"User message..."
);
// test ok.
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::wptr
std::weak_ptr< type_t > wptr
The xtd::uptr object is a weak pointer.
Definition
wptr.h:17
xtd::sptr
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition
sptr.h:25
xtd::console_key::s
@ s
The S key.
xtd
tunit
valid
Generated on Sat Sep 14 2024 21:25:32 for xtd by
Gammasoft
. All rights reserved.