From bc1f1efd8c01950ccb717963719da3aa9b352d10 Mon Sep 17 00:00:00 2001 From: Luc Grosheintz Date: Wed, 19 Jun 2024 10:44:53 +0200 Subject: [PATCH] Remove duplicated tests. (#1011) There's (at least) three attempts at testing read/write cycles for multi-dimensional arrays. The first is whatever is in tests_*multi_dims.cpp. Since it's partial, a second attempt was made: the first half of test_all_types.cpp. Since this was still partial and not quite DRY enough, a third attempt was made. This PR removes the duplicated tests from the first and second attempt, one-by-one. Each commit removes one test. Or moves/reimplements a test if it's not yet covered by the third attempt. There's a fourth attempt in test_high_five_base.cpp; but that's left for another PR. --- doc/developer_guide.md | 2 +- tests/unit/CMakeLists.txt | 2 +- tests/unit/compary_arrays.hpp | 80 ++++++++ tests/unit/data_generator.hpp | 87 +++++--- tests/unit/test_all_types.cpp | 229 +--------------------- tests/unit/test_boost.cpp | 27 +++ tests/unit/test_stl.cpp | 58 ++++++ tests/unit/tests_high_five_multi_dims.cpp | 223 --------------------- 8 files changed, 234 insertions(+), 474 deletions(-) create mode 100644 tests/unit/compary_arrays.hpp create mode 100644 tests/unit/test_boost.cpp create mode 100644 tests/unit/test_stl.cpp delete mode 100644 tests/unit/tests_high_five_multi_dims.cpp diff --git a/doc/developer_guide.md b/doc/developer_guide.md index 0f7af3e01..4537bef20 100644 --- a/doc/developer_guide.md +++ b/doc/developer_guide.md @@ -165,7 +165,7 @@ void check_write(...) { ### Test Organization #### Multi-Dimensional Arrays All tests for reading/writing whole multi-dimensional arrays to datasets or -attributes belong in `tests/unit/tests_high_five_multi_dimensional.cpp`. This +attributes belong in `tests/unit/test_all_types.cpp`. This includes write/read cycles; checking all the generic edges cases, e.g. empty arrays and mismatching sizes; and checking non-reallocation. diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index c8835ba34..10cff1f6f 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -6,7 +6,7 @@ if(MSVC) endif() ## Base tests -foreach(test_name tests_high_five_base tests_high_five_multi_dims tests_high_five_easy test_all_types test_high_five_selection tests_high_five_data_type test_empty_arrays test_legacy test_opencv test_string test_xtensor) +foreach(test_name tests_high_five_base tests_high_five_easy test_all_types test_high_five_selection tests_high_five_data_type test_boost test_empty_arrays test_legacy test_opencv test_string test_stl test_xtensor) add_executable(${test_name} "${test_name}.cpp") target_link_libraries(${test_name} HighFive HighFiveWarnings HighFiveFlags Catch2::Catch2WithMain) target_link_libraries(${test_name} HighFiveOptionalDependencies) diff --git a/tests/unit/compary_arrays.hpp b/tests/unit/compary_arrays.hpp new file mode 100644 index 000000000..8a867a55d --- /dev/null +++ b/tests/unit/compary_arrays.hpp @@ -0,0 +1,80 @@ +/* + * Copyright (c), 2023, 2024 Blue Brain Project - EPFL + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + */ + +#include +#include +#include + +#include + +#include "data_generator.hpp" + +namespace HighFive { +namespace testing { + +template +struct DiffMessageTrait; + +template +struct DiffMessageTrait::value>::type> { + static std::string diff(T a, T b) { + std::stringstream sstream; + sstream << std::scientific << " delta: " << a - b; + return sstream.str(); + } +}; + +template +struct DiffMessageTrait::value>::type> { + static std::string diff(T /* a */, T /* b */) { + return ""; + } +}; + +template +std::string diff_message(T a, T b) { + return DiffMessageTrait::diff(a, b); +} + +template +void compare_arrays(const Actual& actual, + const Expected& expected, + const std::vector& dims, + Comp comp) { + using actual_trait = testing::ContainerTraits; + using expected_trait = testing::ContainerTraits; + using base_type = typename actual_trait::base_type; + + auto n = testing::flat_size(dims); + + for (size_t i = 0; i < n; ++i) { + auto indices = testing::unravel(i, dims); + base_type actual_value = actual_trait::get(actual, indices); + base_type expected_value = expected_trait::get(expected, indices); + auto c = comp(actual_value, expected_value); + if (!c) { + std::stringstream sstream; + sstream << std::scientific << "i = " << i << ": " << actual_value + << " != " << expected_value << diff_message(actual_value, expected_value); + INFO(sstream.str()); + } + REQUIRE(c); + } +} + +template +void compare_arrays(const Actual& actual, + const Expected& expected, + const std::vector& dims) { + using base_type = typename testing::ContainerTraits::base_type; + compare_arrays(expected, actual, dims, [](base_type a, base_type b) { return a == b; }); +} + +} // namespace testing +} // namespace HighFive diff --git a/tests/unit/data_generator.hpp b/tests/unit/data_generator.hpp index d513c3420..e4e7dfa85 100644 --- a/tests/unit/data_generator.hpp +++ b/tests/unit/data_generator.hpp @@ -283,6 +283,38 @@ struct ContainerTraits>: public STLLikeContainerTraits +struct ContainerTraits { + using container_type = T[n]; + using value_type = T; + using base_type = typename ContainerTraits::base_type; + + static constexpr bool is_view = ContainerTraits::is_view; + static constexpr size_t rank = 1 + ContainerTraits::rank; + + static void set(container_type& array, + const std::vector& indices, + const base_type& value) { + return ContainerTraits::set(array[indices[0]], lstrip(indices, 1), value); + } + + static base_type get(const container_type& array, const std::vector& indices) { + return ContainerTraits::get(array[indices[0]], lstrip(indices, 1)); + } + + static void assign(container_type& dst, const container_type& src) { + for (size_t i = 0; i < n; ++i) { + dst[i] = src[i]; + } + } + + static void sanitize_dims(std::vector& dims, size_t axis) { + dims[axis] = n; + ContainerTraits::sanitize_dims(dims, axis + 1); + } +}; + + // -- Boost ------------------------------------------------------------------- #ifdef HIGHFIVE_TEST_BOOST template @@ -723,6 +755,37 @@ struct MultiDimVector { using type = T; }; +template +void initialize_impl(C& array, + const std::vector& dims, + std::vector& indices, + size_t axis, + F f) { + using traits = ContainerTraits; + if (axis == indices.size()) { + auto value = f(indices); + traits::set(array, indices, value); + } else { + for (size_t i = 0; i < dims[axis]; ++i) { + indices[axis] = i; + initialize_impl(array, dims, indices, axis + 1, f); + } + } +} + +template +void initialize(C& array, const std::vector& dims, F f) { + std::vector indices(dims.size()); + initialize_impl(array, dims, indices, 0, f); +} + +template +void initialize(C& array, const std::vector& dims) { + using traits = ContainerTraits; + initialize(array, dims, DefaultValues()); +} + + template class DataGenerator { public: @@ -761,30 +824,6 @@ class DataGenerator { static void sanitize_dims(std::vector& dims) { ContainerTraits::sanitize_dims(dims, /* axis = */ 0); } - - private: - template - static void initialize(C& array, const std::vector& dims, F f) { - std::vector indices(dims.size()); - initialize(array, dims, indices, 0, f); - } - - template - static void initialize(C& array, - const std::vector& dims, - std::vector& indices, - size_t axis, - F f) { - if (axis == indices.size()) { - auto value = f(indices); - traits::set(array, indices, value); - } else { - for (size_t i = 0; i < dims[axis]; ++i) { - indices[axis] = i; - initialize(array, dims, indices, axis + 1, f); - } - } - } }; } // namespace testing diff --git a/tests/unit/test_all_types.cpp b/tests/unit/test_all_types.cpp index cddc73312..0a18e0257 100644 --- a/tests/unit/test_all_types.cpp +++ b/tests/unit/test_all_types.cpp @@ -7,7 +7,6 @@ * */ #include -#include #include @@ -19,6 +18,7 @@ #include "data_generator.hpp" #include "create_traits.hpp" #include "supported_types.hpp" +#include "compary_arrays.hpp" using namespace HighFive; @@ -52,170 +52,6 @@ TEMPLATE_TEST_CASE("Scalar in DataSet", "[Types]", bool, std::string) { } } -TEMPLATE_PRODUCT_TEST_CASE("Scalar in std::vector", "[Types]", std::vector, (bool, std::string)) { - const std::string file_name("rw_dataset_" + typeNameHelper() + ".h5"); - const std::string dataset_name("dset"); - TestType t1(5); - - { - // Create a new file using the default property lists. - File file(file_name, File::ReadWrite | File::Create | File::Truncate); - - // Create the dataset - DataSet dataset = file.createDataSet( - dataset_name, {5}, create_datatype::base_type>()); - - // Write into the initial part of the dataset - dataset.write(t1); - } - - // read it back - { - File file(file_name, File::ReadOnly); - - TestType value; - DataSet dataset = file.getDataSet("/" + dataset_name); - dataset.read(value); - CHECK(t1 == value); - CHECK(value.size() == 5); - } -} - -TEMPLATE_PRODUCT_TEST_CASE("Scalar in std::vector", - "[Types]", - std::vector, - (bool, std::string)) { - const std::string file_name("rw_dataset_vector_" + typeNameHelper() + ".h5"); - const std::string dataset_name("dset"); - std::vector t1(5); - for (auto&& e: t1) { - e.resize(6); - } - - { - // Create a new file using the default property lists. - File file(file_name, File::ReadWrite | File::Create | File::Truncate); - - // Create the dataset - DataSet dataset = file.createDataSet( - dataset_name, - {5, 6}, - create_datatype>::base_type>()); - - // Write into the initial part of the dataset - dataset.write(t1); - } - - // read it back - { - File file(file_name, File::ReadOnly); - - std::vector value; - DataSet dataset = file.getDataSet("/" + dataset_name); - dataset.read(value); - CHECK(t1 == value); - CHECK(value.size() == 5); - } -} - -TEMPLATE_TEST_CASE("Scalar in std::array", "[Types]", bool, std::string) { - const std::string file_name("rw_dataset_array_" + typeNameHelper() + ".h5"); - const std::string dataset_name("dset"); - std::array t1{}; - - { - // Create a new file using the default property lists. - File file(file_name, File::ReadWrite | File::Create | File::Truncate); - - // Create the dataset - DataSet dataset = file.createDataSet( - dataset_name, - {5}, - create_datatype>::base_type>()); - - // Write into the initial part of the dataset - dataset.write(t1); - } - - // read it back - { - File file(file_name, File::ReadOnly); - - std::array value; - DataSet dataset = file.getDataSet("/" + dataset_name); - dataset.read(value); - CHECK(t1 == value); - CHECK(value.size() == 5); - } -} - -TEMPLATE_TEST_CASE("Scalar in std::vector", "[Types]", bool, std::string) { - const std::string file_name("rw_dataset_vector_array_" + typeNameHelper() + ".h5"); - const std::string dataset_name("dset"); - std::vector> t1(5); - - { - // Create a new file using the default property lists. - File file(file_name, File::ReadWrite | File::Create | File::Truncate); - - // Create the dataset - DataSet dataset = file.createDataSet( - dataset_name, - {5, 6}, - create_datatype< - typename details::inspector>>::base_type>()); - - // Write into the initial part of the dataset - dataset.write(t1); - } - - // read it back - { - File file(file_name, File::ReadOnly); - - std::vector> value; - DataSet dataset = file.getDataSet("/" + dataset_name); - dataset.read(value); - CHECK(t1 == value); - CHECK(value.size() == 5); - } -} - -TEMPLATE_TEST_CASE("Scalar in std::array", "[Types]", bool, std::string) { - const std::string file_name("rw_dataset_array_vector" + typeNameHelper() + ".h5"); - const std::string dataset_name("dset"); - std::array, 6> t1; - for (auto& tt: t1) { - tt = std::vector(5); - } - - { - // Create a new file using the default property lists. - File file(file_name, File::ReadWrite | File::Create | File::Truncate); - - // Create the dataset - DataSet dataset = file.createDataSet( - dataset_name, - {6, 5}, - create_datatype< - typename details::inspector>>::base_type>()); - - // Write into the initial part of the dataset - dataset.write(t1); - } - - // read it back - { - File file(file_name, File::ReadOnly); - - std::array, 6> value; - DataSet dataset = file.getDataSet("/" + dataset_name); - dataset.read(value); - CHECK(t1 == value); - CHECK(value.size() == 6); - } -} - #if HIGHFIVE_CXX_STD >= 17 TEMPLATE_PRODUCT_TEST_CASE("Scalar in std::vector", "[Types]", std::vector, std::byte) { const std::string file_name("rw_dataset_vector_" + typeNameHelper() + ".h5"); @@ -246,68 +82,11 @@ TEMPLATE_PRODUCT_TEST_CASE("Scalar in std::vector", "[Types]", std::v } #endif -template -struct DiffMessageTrait; - -template -struct DiffMessageTrait::value>::type> { - static std::string diff(T a, T b) { - std::stringstream sstream; - sstream << std::scientific << " delta: " << a - b; - return sstream.str(); - } -}; - -template -struct DiffMessageTrait::value>::type> { - static std::string diff(T /* a */, T /* b */) { - return ""; - } -}; - -template -std::string diff_message(T a, T b) { - return DiffMessageTrait::diff(a, b); -} - -template -void compare_arrays(const Actual& actual, - const Expected& expected, - const std::vector& dims, - Comp comp) { - using actual_trait = testing::ContainerTraits; - using expected_trait = testing::ContainerTraits; - using base_type = typename actual_trait::base_type; - - auto n = testing::flat_size(dims); - - for (size_t i = 0; i < n; ++i) { - auto indices = testing::unravel(i, dims); - base_type actual_value = actual_trait::get(actual, indices); - base_type expected_value = expected_trait::get(expected, indices); - auto c = comp(actual_value, expected_value); - if (!c) { - std::stringstream sstream; - sstream << std::scientific << "i = " << i << ": " << actual_value - << " != " << expected_value << diff_message(actual_value, expected_value); - INFO(sstream.str()); - } - REQUIRE(c); - } -} - -template -void compare_arrays(const Actual& actual, - const Expected& expected, - const std::vector& dims) { - using base_type = typename testing::ContainerTraits::base_type; - compare_arrays(expected, actual, dims, [](base_type a, base_type b) { return a == b; }); -} template auto check_read_auto(const Expected& expected, const std::vector& dims, const Obj& obj) -> typename std::enable_if::is_view>::type { - compare_arrays(obj.template read(), expected, dims); + testing::compare_arrays(obj.template read(), expected, dims); } template @@ -321,7 +100,7 @@ void check_read_preallocated(const Expected& expected, auto actual = testing::DataGenerator::allocate(dims); obj.read(actual); - compare_arrays(actual, expected, dims); + testing::compare_arrays(actual, expected, dims); testing::ContainerTraits::deallocate(actual, dims); } @@ -388,7 +167,7 @@ void check_writing(const std::vector& dims, Write write) { auto actual = testing::DataGenerator::allocate(dims); obj.read(actual); - compare_arrays(actual, expected, dims); + testing::compare_arrays(actual, expected, dims); testing::ContainerTraits::deallocate(actual, dims); testing::ContainerTraits::deallocate(values, dims); diff --git a/tests/unit/test_boost.cpp b/tests/unit/test_boost.cpp new file mode 100644 index 000000000..72bca9e77 --- /dev/null +++ b/tests/unit/test_boost.cpp @@ -0,0 +1,27 @@ +/* + * Copyright (c), 2024, Blue Brain Project - EPFL + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + */ +#if HIGHFIVE_TEST_BOOST +#include + +#include + +#include +#include + +using namespace HighFive; + +TEST_CASE("Test boost::multi_array with fortran_storage_order") { + const std::string file_name("h5_multi_array_fortran.h5"); + File file(file_name, File::ReadWrite | File::Create | File::Truncate); + + boost::multi_array ma(boost::extents[2][2], boost::fortran_storage_order()); + auto dset = file.createDataSet("main_dset", DataSpace::From(ma)); + CHECK_THROWS_AS(dset.write(ma), DataTypeException); +} +#endif diff --git a/tests/unit/test_stl.cpp b/tests/unit/test_stl.cpp new file mode 100644 index 000000000..42a76c4b9 --- /dev/null +++ b/tests/unit/test_stl.cpp @@ -0,0 +1,58 @@ +/* + * Copyright (c), 2017-2024, Blue Brain Project - EPFL + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + */ + +#include + +#include + + +#include "compary_arrays.hpp" +#include "create_traits.hpp" +#include "data_generator.hpp" + +using namespace HighFive; + +TEST_CASE("std::array undersized", "[stl]") { + auto file = File("rw_std_array_undersized.h5", File::Truncate); + auto x = std::array{1.0, 2.0, 3.0}; + auto dset = file.createDataSet("x", x); + + REQUIRE_THROWS(dset.read>()); + + auto xx = std::array(); + REQUIRE_THROWS(dset.read(xx)); +} + +TEST_CASE("T[n][m]") { + using reference_container = std::vector>; + auto file = File("rw_carray.h5", File::Truncate); + + constexpr size_t n = 3; + constexpr size_t m = 5; + + double x[n][m]; + + SECTION("write") { + testing::initialize(x, {n, m}); + + auto dset = file.createDataSet("x", x); + auto actual = dset.read(); + + testing::compare_arrays(x, actual, {n, m}); + } + + SECTION("read") { + auto expected = testing::DataGenerator::create({n, m}); + + auto dset = file.createDataSet("x", expected); + dset.read(x); + + testing::compare_arrays(expected, x, {n, m}); + } +} diff --git a/tests/unit/tests_high_five_multi_dims.cpp b/tests/unit/tests_high_five_multi_dims.cpp deleted file mode 100644 index a261360e0..000000000 --- a/tests/unit/tests_high_five_multi_dims.cpp +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright (c), 2017-2019, Blue Brain Project - EPFL - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ - -#include -#include - -#include - - -#ifdef HIGHFIVE_TEST_BOOST -#include -#include -#endif - -#include -#include - -#include "tests_high_five.hpp" - -using namespace HighFive; - -/// \brief Test for 2D old-style arrays (T array[x][y]) -template -void readWrite2DArrayTest() { - std::ostringstream filename; - filename << "h5_rw_2d_array_" << typeNameHelper() << "_test.h5"; - const std::string DATASET_NAME("dset"); - const size_t x_size = 100; - const size_t y_size = 10; - - // Create a new file using the default property lists. - File file(filename.str(), File::ReadWrite | File::Create | File::Truncate); - - // Create the data space for the dataset. - std::vector dims{x_size, y_size}; - - DataSpace dataspace(dims); - - // Create a dataset with arbitrary type - DataSet dataset = file.createDataSet(DATASET_NAME, dataspace); - - T array[x_size][y_size]; - - ContentGenerate generator; - generate2D(array, x_size, y_size, generator); - - dataset.write(array); - - T result[x_size][y_size]; - dataset.read(result); - - for (size_t i = 0; i < x_size; ++i) { - for (size_t j = 0; j < y_size; ++j) { - CHECK(result[i][j] == array[i][j]); - } - } -} - -TEMPLATE_LIST_TEST_CASE("ReadWrite2DArray", "[template]", numerical_test_types) { - readWrite2DArrayTest(); -} - -template -void readWriteArrayTest() { - const size_t x_size = 200; - typename std::array vec; - ContentGenerate generator; - std::generate(vec.begin(), vec.end(), generator); - - typename std::array result; - auto dataset = readWriteDataset(vec, result, 1, "std-array"); - - CHECK(result == vec); - - typename std::array tooSmall; - CHECK_THROWS_AS(dataset.read(tooSmall), DataSpaceException); -} - -TEMPLATE_LIST_TEST_CASE("readWriteArray", "[template]", numerical_test_types) { - readWriteArrayTest(); -} - -template -void readWriteVectorNDTest(std::vector& ndvec, const std::vector& dims) { - fillVec(ndvec, dims, ContentGenerate()); - - std::vector result; - readWriteDataset(ndvec, result, dims.size(), "vector"); - - CHECK(checkLength(result, dims)); - CHECK(ndvec == result); -} - -TEMPLATE_LIST_TEST_CASE("readWritSimpleVector", "[template]", numerical_test_types) { - std::vector vec; - readWriteVectorNDTest(vec, {50}); -} - -TEMPLATE_LIST_TEST_CASE("readWrite2DVector", "[template]", numerical_test_types) { - std::vector> _2dvec; - readWriteVectorNDTest(_2dvec, {10, 8}); -} - -TEMPLATE_LIST_TEST_CASE("readWrite3DVector", "[template]", numerical_test_types) { - std::vector>> _3dvec; - readWriteVectorNDTest(_3dvec, {10, 5, 4}); -} - -TEMPLATE_LIST_TEST_CASE("readWrite4DVector", "[template]", numerical_test_types) { - std::vector>>> _4dvec; - readWriteVectorNDTest(_4dvec, {5, 4, 3, 2}); -} - -TEMPLATE_LIST_TEST_CASE("vector of array", "[template]", numerical_test_types) { - std::vector> vec{{1, 2, 3, 4}, {1, 2, 3, 4}}; - std::vector> result; - readWriteDataset(vec, result, 2, "vector"); - - CHECK(vec.size() == result.size()); - CHECK(vec[0].size() == result[0].size()); - CHECK(vec == result); -} - - -#ifdef HIGHFIVE_TEST_BOOST - -template -void MultiArray3DTest() { - typedef typename boost::multi_array MultiArray; - - std::ostringstream filename; - filename << "h5_rw_multiarray_" << typeNameHelper() << "_test.h5"; - - const int size_x = 10, size_y = 10, size_z = 10; - const std::string DATASET_NAME("dset"); - MultiArray array(boost::extents[size_x][size_y][size_z]); - - ContentGenerate generator; - std::generate(array.data(), array.data() + array.num_elements(), generator); - - // Create a new file using the default property lists. - File file(filename.str(), File::ReadWrite | File::Create | File::Truncate); - - DataSet dataset = file.createDataSet(DATASET_NAME, DataSpace::From(array)); - - dataset.write(array); - - // read it back - MultiArray result; - - dataset.read(result); - - for (long i = 0; i < size_x; ++i) { - for (long j = 0; j < size_y; ++j) { - for (long k = 0; k < size_z; ++k) { - CHECK(array[i][j][k] == result[i][j][k]); - } - } - } -} - -TEMPLATE_LIST_TEST_CASE("MultiArray3D", "[template]", numerical_test_types) { - MultiArray3DTest(); -} - -TEST_CASE("Test boost::multi_array with fortran_storage_order") { - const std::string file_name("h5_multi_array_fortran.h5"); - File file(file_name, File::ReadWrite | File::Create | File::Truncate); - - boost::multi_array ma(boost::extents[2][2], boost::fortran_storage_order()); - auto dset = file.createDataSet("main_dset", DataSpace::From(ma)); - CHECK_THROWS_AS(dset.write(ma), DataTypeException); -} - -template -void ublas_matrix_Test() { - using Matrix = boost::numeric::ublas::matrix; - - std::ostringstream filename; - filename << "h5_rw_multiarray_" << typeNameHelper() << "_test.h5"; - - const size_t size_x = 10, size_y = 10; - const std::string DATASET_NAME("dset"); - - Matrix mat(size_x, size_y); - - ContentGenerate generator; - for (std::size_t i = 0; i < mat.size1(); ++i) { - for (std::size_t j = 0; j < mat.size2(); ++j) { - mat(i, j) = generator(); - } - } - - // Create a new file using the default property lists. - File file(filename.str(), File::ReadWrite | File::Create | File::Truncate); - - DataSet dataset = file.createDataSet(DATASET_NAME, DataSpace::From(mat)); - - dataset.write(mat); - - // read it back - Matrix result; - - dataset.read(result); - - for (size_t i = 0; i < size_x; ++i) { - for (size_t j = 0; j < size_y; ++j) { - CHECK(mat(i, j) == result(i, j)); - } - } -} - -TEMPLATE_LIST_TEST_CASE("ublas_matrix", "[template]", numerical_test_types) { - ublas_matrix_Test(); -} - -#endif