diff options
author | Glenn Glazer <coyot@lindenlab.com> | 2016-04-07 12:10:13 -0700 |
---|---|---|
committer | Glenn Glazer <coyot@lindenlab.com> | 2016-04-07 12:10:13 -0700 |
commit | 369cefd5b3f2f52ae0dd203fcd45a4618f74b0f3 (patch) | |
tree | 941d27a32099abaf71bae8a2865002e2b25a3512 /indra/llcorehttp/tests/test_httprequestqueue.hpp | |
parent | 0494a502aafac73800352dc26c4eb3a27b02a8ce (diff) | |
parent | 18928ea6c6f2830a0d45ec412c915eceff1b76b0 (diff) |
pull from viewer-release
Diffstat (limited to 'indra/llcorehttp/tests/test_httprequestqueue.hpp')
-rwxr-xr-x | indra/llcorehttp/tests/test_httprequestqueue.hpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/indra/llcorehttp/tests/test_httprequestqueue.hpp b/indra/llcorehttp/tests/test_httprequestqueue.hpp index 1de2d8f9ab..ef4ce0479b 100755 --- a/indra/llcorehttp/tests/test_httprequestqueue.hpp +++ b/indra/llcorehttp/tests/test_httprequestqueue.hpp @@ -113,16 +113,16 @@ void HttpRequestqueueTestObjectType::test<3>() HttpRequestQueue * rq = HttpRequestQueue::instanceOf(); - HttpOperation * op = new HttpOpNull(); + HttpOperation::ptr_t op(new HttpOpNull()); rq->addOp(op); // transfer my refcount op = rq->fetchOp(true); // Potentially hangs the test on failure - ensure("One goes in, one comes out", NULL != op); - op->release(); + ensure("One goes in, one comes out", static_cast<bool>(op)); + op.reset(); op = rq->fetchOp(false); - ensure("Better not be two of them", NULL == op); + ensure("Better not be two of them", !op); // release the singleton, hold on to the object HttpRequestQueue::term(); @@ -144,13 +144,13 @@ void HttpRequestqueueTestObjectType::test<4>() HttpRequestQueue * rq = HttpRequestQueue::instanceOf(); - HttpOperation * op = new HttpOpNull(); + HttpOperation::ptr_t op (new HttpOpNull()); rq->addOp(op); // transfer my refcount - op = new HttpOpNull(); + op.reset(new HttpOpNull()); rq->addOp(op); // transfer my refcount - op = new HttpOpNull(); + op.reset(new HttpOpNull()); rq->addOp(op); // transfer my refcount { @@ -159,8 +159,9 @@ void HttpRequestqueueTestObjectType::test<4>() ensure("Three go in, three come out", 3 == ops.size()); op = rq->fetchOp(false); - ensure("Better not be any more of them", NULL == op); - + ensure("Better not be any more of them", !op); + op.reset(); + // release the singleton, hold on to the object HttpRequestQueue::term(); @@ -168,12 +169,13 @@ void HttpRequestqueueTestObjectType::test<4>() ensure(mMemTotal < GetMemTotal()); // Release them - while (! ops.empty()) - { - HttpOperation * op = ops.front(); - ops.erase(ops.begin()); - op->release(); - } + ops.clear(); +// while (! ops.empty()) +// { +// HttpOperation * op = ops.front(); +// ops.erase(ops.begin()); +// op->release(); +// } } // Should be clean |