diff options
Diffstat (limited to 'indra/llmath/tests')
-rwxr-xr-x[-rw-r--r--] | indra/llmath/tests/alignment_test.cpp | 39 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/llmath/tests/llbbox_test.cpp | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/llmath/tests/llbboxlocal_test.cpp | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/llmath/tests/llmodularmath_test.cpp | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/llmath/tests/llquaternion_test.cpp | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/llmath/tests/llrect_test.cpp | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/llmath/tests/m3math_test.cpp | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/llmath/tests/mathmisc_test.cpp | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/llmath/tests/v2math_test.cpp | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/llmath/tests/v3color_test.cpp | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/llmath/tests/v3dmath_test.cpp | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/llmath/tests/v3math_test.cpp | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/llmath/tests/v4color_test.cpp | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/llmath/tests/v4coloru_test.cpp | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/llmath/tests/v4math_test.cpp | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/llmath/tests/xform_test.cpp | 0 |
16 files changed, 26 insertions, 13 deletions
diff --git a/indra/llmath/tests/alignment_test.cpp b/indra/llmath/tests/alignment_test.cpp index ac0c45ae6f..5ee3c45502 100644..100755 --- a/indra/llmath/tests/alignment_test.cpp +++ b/indra/llmath/tests/alignment_test.cpp @@ -34,16 +34,6 @@ #include "../llsimdmath.h" #include "../llvector4a.h" -void* operator new(size_t size) -{ - return ll_aligned_malloc_16(size); -} - -void operator delete(void *p) -{ - ll_aligned_free_16(p); -} - namespace tut { @@ -59,6 +49,27 @@ tut::alignment_test_t tut_alignment_test("LLAlignment"); LL_ALIGN_PREFIX(16) class MyVector4a { +public: + void* operator new(size_t size) + { + return ll_aligned_malloc_16(size); + } + + void operator delete(void *p) + { + 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); @@ -68,7 +79,7 @@ template<> template<> void alignment_test_object_t::test<1>() { # ifdef LL_DEBUG - skip("This test fails on Windows when compiled in debug mode."); +// skip("This test fails on Windows when compiled in debug mode."); # endif const int num_tests = 7; @@ -78,7 +89,7 @@ void alignment_test_object_t::test<1>() align_ptr = ll_aligned_malloc_16(sizeof(MyVector4a)); ensure("ll_aligned_malloc_16 failed", is_aligned(align_ptr,16)); - align_ptr = ll_aligned_realloc_16(align_ptr,2*sizeof(MyVector4a)); + align_ptr = ll_aligned_realloc_16(align_ptr,2*sizeof(MyVector4a), sizeof(MyVector4a)); ensure("ll_aligned_realloc_16 failed", is_aligned(align_ptr,16)); ll_aligned_free_16(align_ptr); @@ -105,7 +116,7 @@ template<> template<> void alignment_test_object_t::test<3>() { # ifdef LL_DEBUG - skip("This test fails on Windows when compiled in debug mode."); +// skip("This test fails on Windows when compiled in debug mode."); # endif const int ARR_SIZE = 7; @@ -117,12 +128,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; } } diff --git a/indra/llmath/tests/llbbox_test.cpp b/indra/llmath/tests/llbbox_test.cpp index fd0dbb58fc..fd0dbb58fc 100644..100755 --- a/indra/llmath/tests/llbbox_test.cpp +++ b/indra/llmath/tests/llbbox_test.cpp diff --git a/indra/llmath/tests/llbboxlocal_test.cpp b/indra/llmath/tests/llbboxlocal_test.cpp index f31e4126c4..f31e4126c4 100644..100755 --- a/indra/llmath/tests/llbboxlocal_test.cpp +++ b/indra/llmath/tests/llbboxlocal_test.cpp diff --git a/indra/llmath/tests/llmodularmath_test.cpp b/indra/llmath/tests/llmodularmath_test.cpp index 063d3ef79f..063d3ef79f 100644..100755 --- a/indra/llmath/tests/llmodularmath_test.cpp +++ b/indra/llmath/tests/llmodularmath_test.cpp diff --git a/indra/llmath/tests/llquaternion_test.cpp b/indra/llmath/tests/llquaternion_test.cpp index e69010b2d6..e69010b2d6 100644..100755 --- a/indra/llmath/tests/llquaternion_test.cpp +++ b/indra/llmath/tests/llquaternion_test.cpp diff --git a/indra/llmath/tests/llrect_test.cpp b/indra/llmath/tests/llrect_test.cpp index d740173e69..d740173e69 100644..100755 --- a/indra/llmath/tests/llrect_test.cpp +++ b/indra/llmath/tests/llrect_test.cpp diff --git a/indra/llmath/tests/m3math_test.cpp b/indra/llmath/tests/m3math_test.cpp index 1ca2b005d9..1ca2b005d9 100644..100755 --- a/indra/llmath/tests/m3math_test.cpp +++ b/indra/llmath/tests/m3math_test.cpp diff --git a/indra/llmath/tests/mathmisc_test.cpp b/indra/llmath/tests/mathmisc_test.cpp index 91a2e6c009..91a2e6c009 100644..100755 --- a/indra/llmath/tests/mathmisc_test.cpp +++ b/indra/llmath/tests/mathmisc_test.cpp diff --git a/indra/llmath/tests/v2math_test.cpp b/indra/llmath/tests/v2math_test.cpp index 4d6a2eca93..4d6a2eca93 100644..100755 --- a/indra/llmath/tests/v2math_test.cpp +++ b/indra/llmath/tests/v2math_test.cpp diff --git a/indra/llmath/tests/v3color_test.cpp b/indra/llmath/tests/v3color_test.cpp index 29d1c483ab..29d1c483ab 100644..100755 --- a/indra/llmath/tests/v3color_test.cpp +++ b/indra/llmath/tests/v3color_test.cpp diff --git a/indra/llmath/tests/v3dmath_test.cpp b/indra/llmath/tests/v3dmath_test.cpp index 20b26faa12..20b26faa12 100644..100755 --- a/indra/llmath/tests/v3dmath_test.cpp +++ b/indra/llmath/tests/v3dmath_test.cpp diff --git a/indra/llmath/tests/v3math_test.cpp b/indra/llmath/tests/v3math_test.cpp index e4ae1c10ef..e4ae1c10ef 100644..100755 --- a/indra/llmath/tests/v3math_test.cpp +++ b/indra/llmath/tests/v3math_test.cpp diff --git a/indra/llmath/tests/v4color_test.cpp b/indra/llmath/tests/v4color_test.cpp index d7eec3c87f..d7eec3c87f 100644..100755 --- a/indra/llmath/tests/v4color_test.cpp +++ b/indra/llmath/tests/v4color_test.cpp diff --git a/indra/llmath/tests/v4coloru_test.cpp b/indra/llmath/tests/v4coloru_test.cpp index 128f6f3564..128f6f3564 100644..100755 --- a/indra/llmath/tests/v4coloru_test.cpp +++ b/indra/llmath/tests/v4coloru_test.cpp diff --git a/indra/llmath/tests/v4math_test.cpp b/indra/llmath/tests/v4math_test.cpp index 191ac864df..191ac864df 100644..100755 --- a/indra/llmath/tests/v4math_test.cpp +++ b/indra/llmath/tests/v4math_test.cpp diff --git a/indra/llmath/tests/xform_test.cpp b/indra/llmath/tests/xform_test.cpp index 49870eef3c..49870eef3c 100644..100755 --- a/indra/llmath/tests/xform_test.cpp +++ b/indra/llmath/tests/xform_test.cpp |