aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/basicstuff.cpp
diff options
context:
space:
mode:
authorGravatar Jonathan Hseu <jhseu@google.com>2017-02-11 21:45:32 -0800
committerGravatar Jonathan Hseu <jhseu@google.com>2017-02-11 21:45:32 -0800
commit3453b00a1ef895a4b2eb5f349ab0bf2d50ca0535 (patch)
treec2443e1ef543b8025d9818f8a5b80b86f05a07b2 /test/basicstuff.cpp
parente7ebe52bfb4b0653e69217d9beac75ca7949e165 (diff)
Fix vector indexing with uint64_t
Diffstat (limited to 'test/basicstuff.cpp')
-rw-r--r--test/basicstuff.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp
index 99d91f9da..52b89c0d6 100644
--- a/test/basicstuff.cpp
+++ b/test/basicstuff.cpp
@@ -49,6 +49,19 @@ template<typename MatrixType> void basicStuff(const MatrixType& m)
v1[r] = x;
VERIFY_IS_APPROX(x, v1[r]);
+ // test fetching with various index types.
+ x = v1(static_cast<char>(r));
+ x = v1(static_cast<signed char>(r));
+ x = v1(static_cast<unsigned char>(r));
+ x = v1(static_cast<signed short>(r));
+ x = v1(static_cast<unsigned short>(r));
+ x = v1(static_cast<signed int>(r));
+ x = v1(static_cast<unsigned int>(r));
+ x = v1(static_cast<signed long>(r));
+ x = v1(static_cast<unsigned long>(r));
+ x = v1(static_cast<long long int>(r));
+ x = v1(static_cast<unsigned long long int>(r));
+
VERIFY_IS_APPROX( v1, v1);
VERIFY_IS_NOT_APPROX( v1, 2*v1);
VERIFY_IS_MUCH_SMALLER_THAN( vzero, v1);