From 0d9bd192e6cb08691e8f83435aee929f1618e6d5 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 25 Apr 2017 11:40:41 -0600 Subject: [PATCH] Add tests. --- tests/base/patterns_02.cc | 36 +++++++++++++++++++++++++++++++++ tests/base/patterns_02.output | 2 ++ tests/base/patterns_03.cc | 38 +++++++++++++++++++++++++++++++++++ tests/base/patterns_03.output | 2 ++ 4 files changed, 78 insertions(+) create mode 100644 tests/base/patterns_02.cc create mode 100644 tests/base/patterns_02.output create mode 100644 tests/base/patterns_03.cc create mode 100644 tests/base/patterns_03.output diff --git a/tests/base/patterns_02.cc b/tests/base/patterns_02.cc new file mode 100644 index 0000000000..7b45de1f13 --- /dev/null +++ b/tests/base/patterns_02.cc @@ -0,0 +1,36 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2017 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 at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + +// verify that Patterns::List objects can be copied + +#include "../tests.h" +#include +#include +#include + +int main() +{ + initlog(); + + { + // create one pattern and a copy of it + Patterns::List list(Patterns::Integer(-1,42), 2, 3); + Patterns::List list2 (list); + + // both now go out of scope -- ensure that their destruction does + // not lead to memory corruption + } + deallog << "OK" << std::endl; +} diff --git a/tests/base/patterns_02.output b/tests/base/patterns_02.output new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/base/patterns_02.output @@ -0,0 +1,2 @@ + +DEAL::OK diff --git a/tests/base/patterns_03.cc b/tests/base/patterns_03.cc new file mode 100644 index 0000000000..390fcca055 --- /dev/null +++ b/tests/base/patterns_03.cc @@ -0,0 +1,38 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2017 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 at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + +// verify that Patterns::List objects can be copied + +#include "../tests.h" +#include +#include +#include + +int main() +{ + initlog(); + + { + // create one pattern and a copy of it + Patterns::Map map(Patterns::Integer(-1,42), + Patterns::Double(-1e9, 1e9), + 2, 3); + Patterns::Map map2 (map); + + // both now go out of scope -- ensure that their destruction does + // not lead to memory corruption + } + deallog << "OK" << std::endl; +} diff --git a/tests/base/patterns_03.output b/tests/base/patterns_03.output new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/base/patterns_03.output @@ -0,0 +1,2 @@ + +DEAL::OK -- 2.39.5