33 void Ref (
void)
const;
34 void Unref (
void)
const;
36 mutable uint32_t m_count;
44 void Nothing (
void)
const;
54 void DestroyNotify (
void);
56 virtual void DoRun (
void);
59 uint32_t m_nDestroyed;
71 Base::Ref (
void)
const
76 Base::Unref (
void)
const
91 m_test->DestroyNotify ();
94 NoCount::Nothing ()
const
99 PtrTestCase::PtrTestCase (
void)
100 :
TestCase (
"Sanity checking of Ptr<>")
104 PtrTestCase::DestroyNotify (
void)
124 m_nDestroyed =
false;
128 NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 1,
"XXX");
133 p = Create<NoCount> (
this);
136 NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 1,
"XXX");
141 p1 = Create<NoCount> (
this);
144 NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 1,
"XXX");
149 p1 = Create<NoCount> (
this);
153 NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 1,
"XXX");
158 p1 = Create<NoCount> (
this);
162 NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 2,
"XXX");
167 p1 = Create<NoCount> (
this);
169 p2 = Create<NoCount> (
this);
172 NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 2,
"XXX");
177 p1 = Create<NoCount> (
this);
178 p1 = Create<NoCount> (
this);
180 NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 2,
"XXX");
187 p1 = Create<NoCount> (
this);
188 p2 = Create<NoCount> (
this);
191 NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 1,
"XXX");
193 NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 2,
"XXX");
200 p1 = Create<NoCount> (
this);
201 p2 = Create<NoCount> (
this);
204 NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 1,
"XXX");
206 NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 2,
"XXX");
216 p4 = ConstCast<NoCount> (p5);
241 raw = GetPointer (p);
244 NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 0,
"XXX");
251 const NoCount *v1 = PeekPointer (p);
256 NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 1,
"XXX");
261 NS_TEST_EXPECT_MSG_EQ ((p0 == p1),
false,
"operator == failed");
262 NS_TEST_EXPECT_MSG_EQ ((p0 != p1),
true,
"operator != failed");
smart pointer class similar to boost::intrusive_ptr
TestSuite(std::string name, Type type=UNIT)
Constuct a new test suite.
virtual void DoRun(void)
Implementation to actually run this test case.
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual test case to this test suite.