summaryrefslogtreecommitdiff
path: root/indra/llcommon/tests/llinstancetracker_test.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2012-02-27 14:48:39 -0500
committerNat Goodspeed <nat@lindenlab.com>2012-02-27 14:48:39 -0500
commit063edac43f90d2cb0d2b41db939bbf919a1a3217 (patch)
treebbf1d446baef80933f6be80d05734d68144ae4cc /indra/llcommon/tests/llinstancetracker_test.cpp
parent6f53796ccf4dc29368920a322baeaceb3fd2266f (diff)
parente7ab3da7a7f5c68e3544a64c30f011762572995a (diff)
Automated merge with file:///Users/nat/linden/viewer-leap-daggy
Diffstat (limited to 'indra/llcommon/tests/llinstancetracker_test.cpp')
-rw-r--r--indra/llcommon/tests/llinstancetracker_test.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/indra/llcommon/tests/llinstancetracker_test.cpp b/indra/llcommon/tests/llinstancetracker_test.cpp
index fda932c355..454695ff9f 100644
--- a/indra/llcommon/tests/llinstancetracker_test.cpp
+++ b/indra/llcommon/tests/llinstancetracker_test.cpp
@@ -112,6 +112,7 @@ namespace tut
void object::test<2>()
{
ensure_equals(Unkeyed::instanceCount(), 0);
+ Unkeyed* dangling = NULL;
{
Unkeyed one;
ensure_equals(Unkeyed::instanceCount(), 1);
@@ -124,7 +125,11 @@ namespace tut
ensure_equals(found, two.get());
}
ensure_equals(Unkeyed::instanceCount(), 1);
- }
+ // store an unwise pointer to a temp Unkeyed instance
+ dangling = &one;
+ } // make that instance vanish
+ // check the now-invalid pointer to the destroyed instance
+ ensure("getInstance(T*) failed to track destruction", ! Unkeyed::getInstance(dangling));
ensure_equals(Unkeyed::instanceCount(), 0);
}