From 15ca6659acea545178116096bff3e42068b4f4cb Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Sun, 4 Jan 2009 15:26:32 +0000 Subject: * the 4th template param of Matrix is now Options. One bit for storage order, one bit for enabling/disabling auto-alignment. If you want to disable, do: Matrix The Matrix_ prefix is the only way I can see to avoid ambiguity/pollution. The old RowMajor, ColMajor constants are deprecated, remain for now. * this prompted several improvements in matrix_storage. ei_aligned_array renamed to ei_matrix_array and moved there. The %16==0 tests are now much more centralized in 1 place there. * unalignedassert test: updated * update FindEigen2.cmake from KDElibs * determinant test: use VERIFY_IS_APPROX to fix false positives; add testing of 1 big matrix --- test/unalignedassert.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test/unalignedassert.cpp') diff --git a/test/unalignedassert.cpp b/test/unalignedassert.cpp index 4f9495a51..0b5bf0c77 100644 --- a/test/unalignedassert.cpp +++ b/test/unalignedassert.cpp @@ -67,6 +67,12 @@ struct Good8 : Eigen::WithAlignedOperatorNew Matrix4f m; }; +struct Good9 +{ + Matrix m; // good: no alignment requested + float f; +}; + template void check_unalignedassert_good() { @@ -80,7 +86,7 @@ void check_unalignedassert_good() template void check_unalignedassert_bad() { - float buf[1000]; + float buf[sizeof(T)+16]; float *unaligned = buf; while((reinterpret_cast(unaligned)&0xf)==0) ++unaligned; // make sure unaligned is really unaligned T *x = new(static_cast(unaligned)) T; @@ -97,6 +103,7 @@ void unalignedassert() VERIFY_RAISES_ASSERT(check_unalignedassert_bad()); check_unalignedassert_good(); check_unalignedassert_good(); + check_unalignedassert_good(); } void test_unalignedassert() -- cgit v1.2.3