From b22f8ff19a65091f2c0f6c7bb9351d101dc0fec4 Mon Sep 17 00:00:00 2001 From: DerThorsten Date: Thu, 14 Oct 2021 13:43:58 +0200 Subject: [PATCH] added more tests --- test/CMakeLists.txt | 2 +- ...mplex_float_norm.cpp => test_float_norm.cpp} | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) rename test/{test_complex_float_norm.cpp => test_float_norm.cpp} (72%) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 33d697f..90c6cdf 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -145,7 +145,7 @@ set(XTENSOR_BLAS_TESTS test_dot.cpp test_dot_extended.cpp test_qr.cpp - test_complex_float_norm.cpp + test_float_norm.cpp ) add_executable(test_xtensor_blas ${XTENSOR_BLAS_TESTS} ${XTENSOR_BLAS_HEADERS} ${XTENSOR_HEADERS}) diff --git a/test/test_complex_float_norm.cpp b/test/test_float_norm.cpp similarity index 72% rename from test/test_complex_float_norm.cpp rename to test/test_float_norm.cpp index 6bf1092..b41757b 100644 --- a/test/test_complex_float_norm.cpp +++ b/test/test_float_norm.cpp @@ -21,12 +21,17 @@ namespace xt { -TEST(xblas, norm_complex_float) { - xt::xarray> a = {std::complex(1.0f, 2.0f), std::complex(3.0f, 4.0f)}; - auto res = linalg::norm(a); + TEST(xblas, norm_complex_float) { + xt::xarray> a = {std::complex(1.0f, 2.0f), std::complex(3.0f, 4.0f)}; + auto res = linalg::norm(a); - EXPECT_NEAR(res.real(), 5.4772f, 1e-3f); - EXPECT_NEAR(res.imag(), 0.0f, 1e-3f); -} + EXPECT_NEAR(res.real(), 5.4772f, 1e-3f); + EXPECT_NEAR(res.imag(), 0.0f, 1e-3f); + } + + TEST(xblas, norm_float_arange) + { + xt::linalg::norm(xt::arange(15), 1); + } } \ No newline at end of file