From e126bf4deb400ba2db2f0bffe6376cbfd52445b5 Mon Sep 17 00:00:00 2001
From: thibault allenet <thibault.allenet@cea.fr>
Date: Mon, 15 Jan 2024 15:21:30 +0000
Subject: [PATCH] Update test_TensorImplOpencv

---
 unit_tests/Test_TensorImpl.cpp | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/unit_tests/Test_TensorImpl.cpp b/unit_tests/Test_TensorImpl.cpp
index d560b3b..7da8cca 100644
--- a/unit_tests/Test_TensorImpl.cpp
+++ b/unit_tests/Test_TensorImpl.cpp
@@ -10,6 +10,7 @@ using namespace Aidge;
 TEST_CASE("Tensor creation opencv", "[Tensor][OpenCV]") {
     SECTION("from const array") {
         Tensor x;
+        x.setDataType(Aidge::DataType::Int32);
         x.setBackend("opencv");
         x = Array3D<int,2,2,2>{
         {
@@ -24,6 +25,7 @@ TEST_CASE("Tensor creation opencv", "[Tensor][OpenCV]") {
         }};
 
         Tensor xCopy;
+        xCopy.setDataType(Aidge::DataType::Int32);
         xCopy.setBackend("opencv");
         xCopy = Array3D<int,2,2,2>{
         {
@@ -60,11 +62,11 @@ TEST_CASE("Tensor creation opencv", "[Tensor][OpenCV]") {
         }
 
         SECTION("OpenCV tensor features") {
-            REQUIRE(static_cast<TensorImpl_opencv<int>*>(x.getImpl().get())->data().rows == 2);
-            REQUIRE(static_cast<TensorImpl_opencv<int>*>(x.getImpl().get())->data().cols == 2);
-            REQUIRE(static_cast<TensorImpl_opencv<int>*>(x.getImpl().get())->data().dims == 2);
-            REQUIRE(static_cast<TensorImpl_opencv<int>*>(x.getImpl().get())->data().total() == 4);
-            REQUIRE(static_cast<TensorImpl_opencv<int>*>(x.getImpl().get())->data().channels() == 2);
+            REQUIRE(static_cast<TensorImpl_opencv<int>*>(x.getImpl().get())->getCvMat().rows == 2);
+            REQUIRE(static_cast<TensorImpl_opencv<int>*>(x.getImpl().get())->getCvMat().cols == 2);
+            REQUIRE(static_cast<TensorImpl_opencv<int>*>(x.getImpl().get())->getCvMat().dims == 2);
+            REQUIRE(static_cast<TensorImpl_opencv<int>*>(x.getImpl().get())->getCvMat().total() == 4);
+            REQUIRE(static_cast<TensorImpl_opencv<int>*>(x.getImpl().get())->getCvMat().channels() == 2);
         }
 
         SECTION("Access to array") {
@@ -77,7 +79,7 @@ TEST_CASE("Tensor creation opencv", "[Tensor][OpenCV]") {
             REQUIRE(x.get<int>({0,0,1}) == 2);
             REQUIRE(x.get<int>({0,1,1}) == 4);
             REQUIRE(x.get<int>({1,1,0}) == 7);
-            x.get<int>({1,1,1}) = 36;
+            x.set<int>({1, 1, 1}, 36);
             REQUIRE(x.get<int>({1,1,1}) == 36);
         }
 
-- 
GitLab