From: Wolfgang Bangerth Date: Tue, 25 Apr 2017 17:40:41 +0000 (-0600) Subject: Add tests. X-Git-Tag: v9.0.0-rc1~1650^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d9bd192e6cb08691e8f83435aee929f1618e6d5;p=dealii.git Add tests. --- 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