From 81c308b128f7ebb958c30f67cd095c253d68d57f Mon Sep 17 00:00:00 2001
From: Pietro Incardona <incardon@mpi-cbg.de>
Date: Fri, 2 Nov 2018 22:56:16 +0100
Subject: [PATCH] Fixing warning

---
 src/memory/Memory_unit_tests.hpp | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/memory/Memory_unit_tests.hpp b/src/memory/Memory_unit_tests.hpp
index b1cea1a..2935325 100644
--- a/src/memory/Memory_unit_tests.hpp
+++ b/src/memory/Memory_unit_tests.hpp
@@ -40,7 +40,7 @@ template<typename T> void test()
 	for (size_t i = 0 ; i < mem.size() ; i++)
 	{ptr[i] = i;}
 
-	mem.flush();
+	mem.hostToDevice();
 
 	//! [Allocate some memory and fill with data]
 
@@ -79,9 +79,11 @@ template<typename T> void test()
 
 	unsigned char * ptr = (unsigned char *)src.getPointer();
 	for (size_t i = 0 ; i < src.size() ; i++)
-		ptr[i] = i;
+	{ptr[i] = i;}
 
+	src.hostToDevice();
 	dst.copy(src);
+	dst.deviceToHost();
 
 	for (size_t i = 0 ; i < FIRST_ALLOCATION ; i++)
 	{
@@ -98,11 +100,11 @@ template<typename T> void test()
 
 	unsigned char * ptr = (unsigned char *)src.getPointer();
 	for (size_t i = 0 ; i < src.size() ; i++)
-		ptr[i] = i;
-
-	src.flush();
+	{ptr[i] = i;}
 
+	src.hostToDevice();
 	T dst = src;
+	dst.deviceToHost();
 
 	unsigned char * ptr2 = (unsigned char *)dst.getPointer();
 
@@ -236,11 +238,7 @@ void copy_device_host_test()
 	mem1.allocate(300);
 	mem2.allocate(500);
 
-	if (mem1.isDeviceHostSame() == true)
-	{
-		BOOST_REQUIRE_EQUAL(mem1.getPointer(),mem1.getDevicePointer());
-	}
-	else
+	if (mem1.isDeviceHostSame() == false)
 	{
 		BOOST_REQUIRE(mem1.getPointer() != mem2.getDevicePointer());
 	}
-- 
GitLab