summaryrefslogtreecommitdiff
path: root/indra/llmath/tests
diff options
context:
space:
mode:
authorsimon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com>2012-09-12 16:00:12 -0700
committersimon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com>2012-09-12 16:00:12 -0700
commitcd315c0ecdf0dbcc6a5fb18d60cbb31ee06e9acd (patch)
tree14f60bfb9cc53d45dd7e34871ef7126d48a3cdee /indra/llmath/tests
parent8a359ddaea5ff24233b758ee2697234d9e6d0d9c (diff)
Fix alignment_test for array allocations. Reviewed by Runitai
Diffstat (limited to 'indra/llmath/tests')
-rw-r--r--indra/llmath/tests/alignment_test.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/indra/llmath/tests/alignment_test.cpp b/indra/llmath/tests/alignment_test.cpp
index 289d25a63c..bbc68fc498 100644
--- a/indra/llmath/tests/alignment_test.cpp
+++ b/indra/llmath/tests/alignment_test.cpp
@@ -60,6 +60,16 @@ public:
ll_aligned_free_16(p);
}
+ void* operator new[](size_t count)
+ { // try to allocate count bytes for an array
+ return ll_aligned_malloc_16(count);
+ }
+
+ void operator delete[](void *p)
+ {
+ ll_aligned_free_16(p);
+ }
+
LLQuad mQ;
} LL_ALIGN_POSTFIX(16);
@@ -112,7 +122,7 @@ void alignment_test_object_t::test<3>()
// skip("This test fails on Windows when compiled in debug mode.");
# endif
- /*const int ARR_SIZE = 7;
+ const int ARR_SIZE = 7;
for(int i=0; i<ARR_SIZE; i++)
{
MyVector4a *vecp = new MyVector4a;
@@ -121,12 +131,14 @@ void alignment_test_object_t::test<3>()
}
MyVector4a *veca = new MyVector4a[ARR_SIZE];
+ //std::cout << "veca base is " << (S32) veca << std::endl;
ensure("LLAligment veca base", is_aligned(veca,16));
for(int i=0; i<ARR_SIZE; i++)
{
std::cout << "veca[" << i << "]" << std::endl;
ensure("LLAlignment veca member unaligned", is_aligned(&veca[i],16));
- }*/
+ }
+ delete [] veca;
}
}