From 311b2717da592824f9f5aaf624761c0ad424a39c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkjak@fjfi.cvut.cz> Date: Wed, 10 Apr 2019 14:36:59 +0200 Subject: [PATCH] Fixed DistributedArrayTest --- src/UnitTests/Containers/DistributedArrayTest.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/UnitTests/Containers/DistributedArrayTest.h b/src/UnitTests/Containers/DistributedArrayTest.h index 169a98b7a9..381539af6b 100644 --- a/src/UnitTests/Containers/DistributedArrayTest.h +++ b/src/UnitTests/Containers/DistributedArrayTest.h @@ -88,11 +88,15 @@ TYPED_TEST( DistributedArrayTest, copyFromGlobal ) using ArrayType = typename TestFixture::ArrayType; this->distributedArray.setValue( 0.0 ); - ArrayViewType localArrayView = this->distributedArray.getLocalArrayView(); ArrayType globalArray( this->globalSize ); globalArray.setValue( 1.0 ); this->distributedArray.copyFromGlobal( globalArray ); - EXPECT_EQ( localArrayView, globalArray ); + + ArrayViewType localArrayView = this->distributedArray.getLocalArrayView(); + auto globalView = globalArray.getConstView(); + const auto localRange = this->distributedArray.getLocalRange(); + globalView.bind( &globalArray[ localRange.getBegin() ], localRange.getEnd() - localRange.getBegin() ); + EXPECT_EQ( localArrayView, globalView ); } TYPED_TEST( DistributedArrayTest, setLike ) -- GitLab