From: Martin Kronbichler Date: Mon, 30 Mar 2020 06:21:46 +0000 (+0200) Subject: Two test cases X-Git-Tag: v9.2.0-rc1~327^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9775%2Fhead;p=dealii.git Two test cases --- diff --git a/tests/base/utilities_21.cc b/tests/base/utilities_21.cc new file mode 100644 index 0000000000..dba99a2de5 --- /dev/null +++ b/tests/base/utilities_21.cc @@ -0,0 +1,45 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2019 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 Utilities::pow + +#include + +#include "../tests.h" + + + +int +main() +{ + initlog(); + + constexpr int a = Utilities::pow(100, 2); + constexpr int b = Utilities::pow(200, 2); + constexpr int c = Utilities::pow(215, 2); + constexpr int d = Utilities::pow(216, 2); + constexpr int e = Utilities::pow(500, 2); + constexpr int f = Utilities::pow(600, 2); + constexpr int g = Utilities::pow(700, 2); + constexpr int h = Utilities::pow(800, 2); + constexpr int i = Utilities::pow(900, 2); + constexpr int j = Utilities::pow(215, 3); + constexpr int k = Utilities::pow(216, 3); + constexpr int l = Utilities::pow(1285, 3); + deallog << a + b + c + d + e + f + g + h + i + j + k + l << std::endl; + + return 0; +} diff --git a/tests/base/utilities_21.output b/tests/base/utilities_21.output new file mode 100644 index 0000000000..5422bfb136 --- /dev/null +++ b/tests/base/utilities_21.output @@ -0,0 +1,2 @@ + +DEAL::2144533077 diff --git a/tests/base/utilities_22.cc b/tests/base/utilities_22.cc new file mode 100644 index 0000000000..e7142e66c6 --- /dev/null +++ b/tests/base/utilities_22.cc @@ -0,0 +1,33 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2019 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 Utilities::pow where we should get an integer overflow and thus a +// compile error + +#include + +#include "../tests.h" + + + +int +main() +{ + initlog(); + + constexpr int a = Utilities::pow(216, 4); + deallog << a << std::endl; +} diff --git a/tests/base/utilities_22.expect=build.output b/tests/base/utilities_22.expect=build.output new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/base/utilities_22.expect=build.output @@ -0,0 +1,2 @@ + +DEAL::OK