cmoon::test::assert_is_instance
Defined in module
<cmoon.test>
|
(1) |
Throws an assert_exception
if the expression dynamic_cast<const Type*>(std::addressof(obj))
is nullptr
.
Parameters
obj | - | Object to be casted to Type |
message | - | Extra information to be added to the error message |
location | - | Information about where in the file this assertion was ran |
Return value
(none)
Example
import <sstream>;
import <iostream>;
import cmoon.test;
class example_test : public cmoon::test::test_case
{
public:
example_test()
: cmoon::test::test_case{"example test"} {}
void operator()() override
{
std::stringstream stream;
cmoon::test::assert_is_instance<std::iostream>(stream);
}
};