diff options
| author | prep <prep@lindenlab.com> | 2011-09-14 10:41:52 -0400 |
|---|---|---|
| committer | prep <prep@lindenlab.com> | 2011-09-14 10:41:52 -0400 |
| commit | df40eca093b1a238daea9cd23c44f6e39719bf51 (patch) | |
| tree | 205c15512a7fa363ebcea0de8e3ce16a3a58ca38 /indra/llcommon/tests/llinstancetracker_test.cpp | |
| parent | 4efca483d7dc8c8a50ebe247c6c163c263ed20f5 (diff) | |
| parent | a250df980b3f37e245d30e51ab65831ae1de0ce0 (diff) | |
merge
Diffstat (limited to 'indra/llcommon/tests/llinstancetracker_test.cpp')
| -rw-r--r-- | indra/llcommon/tests/llinstancetracker_test.cpp | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/indra/llcommon/tests/llinstancetracker_test.cpp b/indra/llcommon/tests/llinstancetracker_test.cpp index 80b35bbdc3..b34d1c5fd3 100644 --- a/indra/llcommon/tests/llinstancetracker_test.cpp +++ b/indra/llcommon/tests/llinstancetracker_test.cpp @@ -40,6 +40,7 @@ #include <boost/scoped_ptr.hpp> // other Linden headers #include "../test/lltut.h" +#include "wrapllerrs.h" struct Keyed: public LLInstanceTracker<Keyed, std::string> { @@ -165,4 +166,67 @@ namespace tut ensure_equals("unreported instance", instances.size(), 0); } + + template<> template<> + void object::test<5>() + { + set_test_name("delete Keyed with outstanding instance_iter"); + std::string what; + Keyed* keyed = new Keyed("one"); + { + WrapLL_ERRS wrapper; + Keyed::instance_iter i(Keyed::beginInstances()); + try + { + delete keyed; + } + catch (const WrapLL_ERRS::FatalException& e) + { + what = e.what(); + } + } + ensure(! what.empty()); + } + + template<> template<> + void object::test<6>() + { + set_test_name("delete Keyed with outstanding key_iter"); + std::string what; + Keyed* keyed = new Keyed("one"); + { + WrapLL_ERRS wrapper; + Keyed::key_iter i(Keyed::beginKeys()); + try + { + delete keyed; + } + catch (const WrapLL_ERRS::FatalException& e) + { + what = e.what(); + } + } + ensure(! what.empty()); + } + + template<> template<> + void object::test<7>() + { + set_test_name("delete Unkeyed with outstanding instance_iter"); + std::string what; + Unkeyed* unkeyed = new Unkeyed; + { + WrapLL_ERRS wrapper; + Unkeyed::instance_iter i(Unkeyed::beginInstances()); + try + { + delete unkeyed; + } + catch (const WrapLL_ERRS::FatalException& e) + { + what = e.what(); + } + } + ensure(! what.empty()); + } } // namespace tut |
