From 60b223534a416ebc82fece6a7688aed0da1b045e Mon Sep 17 00:00:00 2001
From: ls232920 <laurent.soulier@cea.fr>
Date: Wed, 18 Oct 2023 17:03:59 +0000
Subject: [PATCH] [UT] unit test for "view" cosntruction

---
 unit_tests/data/Test_TensorImpl.cpp | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/unit_tests/data/Test_TensorImpl.cpp b/unit_tests/data/Test_TensorImpl.cpp
index e2a8840b..9d8bbb2e 100644
--- a/unit_tests/data/Test_TensorImpl.cpp
+++ b/unit_tests/data/Test_TensorImpl.cpp
@@ -193,18 +193,18 @@ TEST_CASE("Tensor extract")
         Rainbow.setDatatype(DataType::UInt16);
         Rainbow.setBackend("cpu");
         MakeRainbow<std::uint16_t>(Rainbow);
-        // Tensor view(Rainbow, {2, 2, 3}, {0, 1, 1});
-        // for (Coord_t a = 0; a < view.dims()[0]; ++a)
-        // {
-        //     for (Coord_t b = 0; b < view.dims()[1]; ++b)
-        //     {
-        //         for (Coord_t c = 0; c < view.dims()[2]; ++c)
-        //         {
-        //             REQUIRE(
-        //                 view.get<std::uint16_t>({a, b + 1, c + 1})
-        //                 == Rainbow.get<std::uint16_t>({a, b + 1, c + 1}));
-        //         }
-        //     }
-        // }
+        Tensor view(Rainbow, {2, 2, 3}, {0, 1, 1});
+        for (Coord_t a = 0; a < view.dims()[0]; ++a)
+        {
+            for (Coord_t b = 0; b < view.dims()[1]; ++b)
+            {
+                for (Coord_t c = 0; c < view.dims()[2]; ++c)
+                {
+                    REQUIRE(
+                        view.get<std::uint16_t>({a, b + 1, c + 1})
+                        == Rainbow.get<std::uint16_t>({a, b + 1, c + 1}));
+                }
+            }
+        }
     }
 }
\ No newline at end of file
-- 
GitLab