From c6d1d73c1e9b1ae48d448f5229c224ea43c87046 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Fri, 19 Feb 2021 19:13:44 -0600 Subject: [PATCH] add a test --- tests/base/ndarray.cc | 54 +++++++++++++++++++++++++++++++++++++++ tests/base/ndarray.output | 1 + 2 files changed, 55 insertions(+) create mode 100644 tests/base/ndarray.cc create mode 100644 tests/base/ndarray.output diff --git a/tests/base/ndarray.cc b/tests/base/ndarray.cc new file mode 100644 index 0000000000..be4d074c66 --- /dev/null +++ b/tests/base/ndarray.cc @@ -0,0 +1,54 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2021 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE.md at +// the top level directory of deal.II. +// +// --------------------------------------------------------------------- + + +// test that the ndarray type alias does what it promises to do. + +#include + +#include + +#include "../tests.h" + +int +main() +{ + initlog(); + + dealii::ndarray r0; + dealii::ndarray r1; + dealii::ndarray r2; + dealii::ndarray r3; + dealii::ndarray r4; + + static_assert(std::is_same::value, + "types must be the same"); + static_assert(std::is_same>::value, + "types must be the same"); + static_assert( + std::is_same, 1>>::value, + "types must be the same"); + static_assert( + std::is_same, 2>, 1>>::value, + "types must be the same"); + static_assert( + std::is_same, 3>, 2>, + 1>>::value, + "types must be the same"); + + return 0; +} diff --git a/tests/base/ndarray.output b/tests/base/ndarray.output new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/tests/base/ndarray.output @@ -0,0 +1 @@ + -- 2.39.5