void weak_basic_test(void) { ASSERT_INVALID("Core::Weak::Weak() INVALID", Core::Weak<int>()); Core::Shared<int> svalid(new int); Core::Weak<int> valid(svalid); ASSERT_VALID("Core::Weak::Weak()", valid); /* clear valid weak pointer */ valid.clear(); ASSERT_INVALID("Core::Weak::clear()", valid); }
void weak_basic_test(void) { TEST("TEST INVALID WEAK POINTER", !Core::Weak<int>()); Core::Shared<int> svalid(new int); Core::Weak<int> valid(svalid); TEST("TEST VALID WEAK POINTER", valid); /* clear valid weak pointer */ valid.clear(); TEST("TEST INVALIDATED WEAK POINTER", !valid); }