diff options
author | Jitse Niesen <jitse@maths.leeds.ac.uk> | 2011-04-05 18:15:59 +0100 |
---|---|---|
committer | Jitse Niesen <jitse@maths.leeds.ac.uk> | 2011-04-05 18:15:59 +0100 |
commit | cca7b146a2018a74aa5f83edc0797fab89b1040e (patch) | |
tree | befd747f5994e5e408fa211f1da5038106ce0597 /test/evaluators.cpp | |
parent | a6b5314c205a2a6257d756c1a529dfb4d56817f0 (diff) |
Implement evaluator for Map
Diffstat (limited to 'test/evaluators.cpp')
-rw-r--r-- | test/evaluators.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/evaluators.cpp b/test/evaluators.cpp index e3fe53215..b2bc42840 100644 --- a/test/evaluators.cpp +++ b/test/evaluators.cpp @@ -142,4 +142,16 @@ void test_evaluators() copy_using_evaluator(mX.block(4, 4, 9, 12), mXsrc); mXref.block(4, 4, 9, 12) = mXsrc; VERIFY_IS_APPROX(mX, mXref); + + // Testing Map + const float raw[3] = {1,2,3}; + float buffer[3] = {0,0,0}; + Vector3f v3; + Array3f a3f; + VERIFY_IS_APPROX_EVALUATOR(v3, Map<const Vector3f>(raw)); + VERIFY_IS_APPROX_EVALUATOR(a3f, Map<const Array3f>(raw)); + Vector3f::Map(buffer) = 2*v3; + VERIFY(buffer[0] == 2); + VERIFY(buffer[1] == 4); + VERIFY(buffer[2] == 6); } |