added first tests for reading files

This commit is contained in:
Erik Fröjdh
2024-03-27 18:03:18 +01:00
parent f848c00799
commit 6e8cf179c7
10 changed files with 146 additions and 10 deletions

View File

@ -175,4 +175,20 @@ TEST_CASE("Retrieve shape"){
REQUIRE(data.shape()[0] == 3);
REQUIRE(data.shape()[1] == 4);
}
TEST_CASE("compare two views"){
std::vector<int> vec1;
for (int i = 0; i != 12; ++i) {
vec1.push_back(i);
}
NDView<int,2> view1(vec1.data(), Shape<2>{3,4});
std::vector<int> vec2;
for (int i = 0; i != 12; ++i) {
vec2.push_back(i);
}
NDView<int,2> view2(vec2.data(), Shape<2>{3,4});
REQUIRE(view1 == view2);
}