summaryrefslogtreecommitdiff
path: root/ACE/tests/Intrusive_Auto_Ptr_Test.cpp
diff options
context:
space:
mode:
authorLike Ma <likemartinma@gmail.com>2015-01-12 11:34:58 +0800
committerLike Ma <likemartinma@gmail.com>2015-01-12 11:34:58 +0800
commit10b172a0a1942bb4a57b5469a79d7d435d3e3f5a (patch)
tree8d32aae76959928c54e2c1fc48dd329678c90ba4 /ACE/tests/Intrusive_Auto_Ptr_Test.cpp
parent1cd7f9aeb45bf7f7a072b49c6675f1560c3af64e (diff)
downloadATCD-10b172a0a1942bb4a57b5469a79d7d435d3e3f5a.tar.gz
Add comments to Intrusive_Auto_Ptr unit test.
Diffstat (limited to 'ACE/tests/Intrusive_Auto_Ptr_Test.cpp')
-rw-r--r--ACE/tests/Intrusive_Auto_Ptr_Test.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/ACE/tests/Intrusive_Auto_Ptr_Test.cpp b/ACE/tests/Intrusive_Auto_Ptr_Test.cpp
index 1bd3165e248..ae363730966 100644
--- a/ACE/tests/Intrusive_Auto_Ptr_Test.cpp
+++ b/ACE/tests/Intrusive_Auto_Ptr_Test.cpp
@@ -93,17 +93,22 @@ int run_main (int, ACE_TCHAR *[])
ACE_TEST_ASSERT (One::was_released());
- // Test assignment.
+ // Test assigning zero.
theone = new One(0);
{
ACE_TEST_ASSERT (theone->has_refs (0));
ACE_TEST_ASSERT (!One::was_released ());
+ // Transfer object to instrusive auto ptr.
+ // The reference is expected to increment to 1.
ACE_Intrusive_Auto_Ptr<One> ip2(theone);
ACE_TEST_ASSERT (theone->has_refs (1));
ACE_TEST_ASSERT (!One::was_released ());
+ // Assign a zero instrusive auto ptr.
+ // The reference is expected to decrement to 0, so that the object is
+ // expected to be released.
ACE_Intrusive_Auto_Ptr<One> ip3;
ip2 = ip3;
ACE_TEST_ASSERT (One::was_released ());