From 3730e3ca9ec8e256b76c08fb4b1e928c62f37b40 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 6 Jan 2017 13:10:10 +0100 Subject: Use "fix" for compile-time values, propagate compile-time sizes for span, clean some cleanup. --- test/indexed_view.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'test/indexed_view.cpp') diff --git a/test/indexed_view.cpp b/test/indexed_view.cpp index 1bb2b4256..0be5e434c 100644 --- a/test/indexed_view.cpp +++ b/test/indexed_view.cpp @@ -13,8 +13,8 @@ typedef std::pair IndexPair; -Index encode(Index i, Index j) { - return i*100 + j; +int encode(Index i, Index j) { + return int(i*100 + j); } IndexPair decode(Index ij) { @@ -97,6 +97,17 @@ void check_indexed_view() "300 301 302 303 304 305 306 307 308 309") ); + Array44i B; + VERIFY( (A(span(2,5), 5)).ColsAtCompileTime == 1); + VERIFY( (A(span(2,5), 5)).RowsAtCompileTime == Dynamic); + VERIFY( (A(span(2,fix<5>), 5)).RowsAtCompileTime == 5); + VERIFY( (A(4, all)).ColsAtCompileTime == Dynamic); + VERIFY( (A(4, all)).RowsAtCompileTime == 1); + VERIFY( (B(1, all)).ColsAtCompileTime == 4); + VERIFY( (B(1, all)).RowsAtCompileTime == 1); + VERIFY( (B(all,1)).ColsAtCompileTime == 1); + VERIFY( (B(all,1)).RowsAtCompileTime == 4); + } void test_indexed_view() -- cgit v1.2.3