]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add tests. 4312/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 25 Apr 2017 17:40:41 +0000 (11:40 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 25 Apr 2017 17:40:41 +0000 (11:40 -0600)
tests/base/patterns_02.cc [new file with mode: 0644]
tests/base/patterns_02.output [new file with mode: 0644]
tests/base/patterns_03.cc [new file with mode: 0644]
tests/base/patterns_03.output [new file with mode: 0644]

diff --git a/tests/base/patterns_02.cc b/tests/base/patterns_02.cc
new file mode 100644 (file)
index 0000000..7b45de1
--- /dev/null
@@ -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 <deal.II/base/parameter_handler.h>
+#include <deal.II/base/logstream.h>
+#include <memory>
+
+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 (file)
index 0000000..0fd8fc1
--- /dev/null
@@ -0,0 +1,2 @@
+
+DEAL::OK
diff --git a/tests/base/patterns_03.cc b/tests/base/patterns_03.cc
new file mode 100644 (file)
index 0000000..390fcca
--- /dev/null
@@ -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 <deal.II/base/parameter_handler.h>
+#include <deal.II/base/logstream.h>
+#include <memory>
+
+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 (file)
index 0000000..0fd8fc1
--- /dev/null
@@ -0,0 +1,2 @@
+
+DEAL::OK

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.