summaryrefslogtreecommitdiff
path: root/indra/llcorehttp/tests/test_refcounted.hpp
diff options
context:
space:
mode:
authorDave Houlton <euclid@lindenlab.com>2020-07-23 12:21:18 -0600
committerDave Houlton <euclid@lindenlab.com>2020-07-23 12:21:18 -0600
commit64a9ad0f5f52dac633a76e39335a7def2573b82e (patch)
treee47af1ff1bd1db52fd93c11d857b11387bacf01a /indra/llcorehttp/tests/test_refcounted.hpp
parent05200cf827d9a6263adc4905bf41a4905bce2659 (diff)
parent72423372d6cd7f763a5567ad75752fa4e7131d60 (diff)
Merge branch 'master' v6.4.6 into DRTVWR-497
Diffstat (limited to 'indra/llcorehttp/tests/test_refcounted.hpp')
-rw-r--r--indra/llcorehttp/tests/test_refcounted.hpp37
1 files changed, 3 insertions, 34 deletions
diff --git a/indra/llcorehttp/tests/test_refcounted.hpp b/indra/llcorehttp/tests/test_refcounted.hpp
index 5dff143e5d..2310812d5a 100644
--- a/indra/llcorehttp/tests/test_refcounted.hpp
+++ b/indra/llcorehttp/tests/test_refcounted.hpp
@@ -28,9 +28,8 @@
#include "_refcounted.h"
-#include "test_allocator.h"
-
-#if 0 // disable all of this because it's hanging win64 builds?
+// disable all of this because it's hanging win64 builds?
+#if ! (LL_WINDOWS && ADDRESS_SIZE == 64)
using namespace LLCoreInt;
namespace tut
@@ -39,7 +38,6 @@ namespace tut
{
// the test objects inherit from this so the member functions and variables
// can be referenced directly inside of the test functions.
- size_t mMemTotal;
};
typedef test_group<RefCountedTestData> RefCountedTestGroupType;
@@ -51,18 +49,12 @@ namespace tut
{
set_test_name("RefCounted construction with implicit count");
- // record the total amount of dynamically allocated memory
- mMemTotal = GetMemTotal();
-
// create a new ref counted object with an implicit reference
RefCounted * rc = new RefCounted(true);
ensure(rc->getRefCount() == 1);
// release the implicit reference, causing the object to be released
rc->release();
-
- // make sure we didn't leak any memory
- ensure(mMemTotal == GetMemTotal());
}
template <> template <>
@@ -70,9 +62,6 @@ namespace tut
{
set_test_name("RefCounted construction without implicit count");
- // record the total amount of dynamically allocated memory
- mMemTotal = GetMemTotal();
-
// create a new ref counted object with an implicit reference
RefCounted * rc = new RefCounted(false);
ensure(rc->getRefCount() == 0);
@@ -83,8 +72,6 @@ namespace tut
// release the implicit reference, causing the object to be released
rc->release();
-
- ensure(mMemTotal == GetMemTotal());
}
template <> template <>
@@ -92,9 +79,6 @@ namespace tut
{
set_test_name("RefCounted addRef and release");
- // record the total amount of dynamically allocated memory
- mMemTotal = GetMemTotal();
-
RefCounted * rc = new RefCounted(false);
for (int i = 0; i < 1024; ++i)
@@ -108,9 +92,6 @@ namespace tut
{
rc->release();
}
-
- // make sure we didn't leak any memory
- ensure(mMemTotal == GetMemTotal());
}
template <> template <>
@@ -118,9 +99,6 @@ namespace tut
{
set_test_name("RefCounted isLastRef check");
- // record the total amount of dynamically allocated memory
- mMemTotal = GetMemTotal();
-
RefCounted * rc = new RefCounted(true);
// with only one reference, isLastRef should be true
@@ -128,9 +106,6 @@ namespace tut
// release it to clean up memory
rc->release();
-
- // make sure we didn't leak any memory
- ensure(mMemTotal == GetMemTotal());
}
template <> template <>
@@ -138,9 +113,6 @@ namespace tut
{
set_test_name("RefCounted noRef check");
- // record the total amount of dynamically allocated memory
- mMemTotal = GetMemTotal();
-
RefCounted * rc = new RefCounted(false);
// set the noRef
@@ -148,10 +120,7 @@ namespace tut
// with only one reference, isLastRef should be true
ensure(rc->getRefCount() == RefCounted::NOT_REF_COUNTED);
-
- // allow this memory leak, but check that we're leaking a known amount
- ensure(mMemTotal == (GetMemTotal() - sizeof(RefCounted)));
}
}
-#endif // if 0
+#endif // disabling on Win64
#endif // TEST_LLCOREINT_REF_COUNTED_H_