clang-format
Build on RHEL8 / build (push) Successful in 2m30s
Build on RHEL9 / build (push) Successful in 2m34s
Run tests using data on local RHEL8 / build (push) Failing after 3m10s

This commit is contained in:
2026-02-19 15:35:19 +01:00
parent 1f7a87cc30
commit 5dbc746462
34 changed files with 327 additions and 350 deletions
+5 -13
View File
@@ -2,10 +2,10 @@
#include "aare/NDView.hpp"
#include <catch2/catch_test_macros.hpp>
#include <cstddef>
#include <iostream>
#include <numeric>
#include <vector>
#include <cstddef>
using aare::NDView;
using aare::Shape;
@@ -23,7 +23,6 @@ TEST_CASE("Element reference 1D") {
}
}
TEST_CASE("Assign elements through () and []") {
std::vector<int> vec;
for (int i = 0; i != 10; ++i) {
@@ -31,11 +30,10 @@ TEST_CASE("Assign elements through () and []") {
}
NDView<int, 1> data(vec.data(), Shape<1>{10});
REQUIRE(vec.size() == static_cast<size_t>(data.size()));
data[3] = 187;
data(4) = 512;
REQUIRE(data(0) == 0);
REQUIRE(data[0] == 0);
REQUIRE(data(1) == 1);
@@ -56,8 +54,6 @@ TEST_CASE("Assign elements through () and []") {
REQUIRE(data[8] == 8);
REQUIRE(data(9) == 9);
REQUIRE(data[9] == 9);
}
TEST_CASE("Element reference 1D with a const NDView") {
@@ -73,7 +69,6 @@ TEST_CASE("Element reference 1D with a const NDView") {
}
}
TEST_CASE("Element reference 2D") {
std::vector<int> vec(12);
std::iota(vec.begin(), vec.end(), 0);
@@ -190,8 +185,6 @@ TEST_CASE("iterators") {
}
}
TEST_CASE("divide with another NDView") {
std::vector<int> vec0{9, 12, 3};
std::vector<int> vec1{3, 2, 1};
@@ -229,7 +222,7 @@ TEST_CASE("compare two views") {
REQUIRE((view1 == view2));
}
TEST_CASE("Compare two views with different size"){
TEST_CASE("Compare two views with different size") {
std::vector<int> vec1(12);
std::iota(vec1.begin(), vec1.end(), 0);
NDView<int, 2> view1(vec1.data(), Shape<2>{3, 4});
@@ -241,7 +234,7 @@ TEST_CASE("Compare two views with different size"){
REQUIRE_FALSE(view1 == view2);
}
TEST_CASE("Compare two views with same size but different shape"){
TEST_CASE("Compare two views with same size but different shape") {
std::vector<int> vec1(12);
std::iota(vec1.begin(), vec1.end(), 0);
NDView<int, 2> view1(vec1.data(), Shape<2>{3, 4});
@@ -262,10 +255,9 @@ TEST_CASE("Create a view over a vector") {
REQUIRE(v[11] == 11);
}
TEST_CASE("NDView over byte"){
TEST_CASE("NDView over byte") {
std::vector<std::byte> buf(5);
auto v = aare::make_view(buf);
REQUIRE(v.shape()[0] == 5);
REQUIRE(v[0] == std::byte{0});
}