]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add another test.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 2 Nov 2010 02:52:48 +0000 (02:52 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 2 Nov 2010 02:52:48 +0000 (02:52 +0000)
git-svn-id: https://svn.dealii.org/trunk@22582 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/patterns_01.cc [new file with mode: 0644]
tests/base/patterns_01/cmp/generic [new file with mode: 0644]

diff --git a/tests/base/patterns_01.cc b/tests/base/patterns_01.cc
new file mode 100644 (file)
index 0000000..5b926be
--- /dev/null
@@ -0,0 +1,44 @@
+//-----------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2005, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//-----------------------------------------------------------------------------
+
+#include "../tests.h"
+#include <base/parameter_handler.h>
+#include <base/logstream.h>
+#include <memory>
+
+int main()
+{
+  std::ofstream logfile("patterns_01/output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+                                  // create a pattern and let it
+                                  // output its description
+  Patterns::Integer pattern(-1,42);
+  const std::string desc = pattern.description();
+
+                                  // now let the same class re-create
+                                  // a pattern object from the
+                                  // description and verify that the
+                                  // result is the same as what we
+                                  // started out with
+  Patterns::Integer * pattern2 = Patterns::Integer::create (desc);
+
+  Assert (pattern2 != 0, ExcInternalError());
+  Assert (desc == pattern2->description(), ExcInternalError());
+
+  deallog << desc << std::endl;
+
+  delete pattern2;
+}
diff --git a/tests/base/patterns_01/cmp/generic b/tests/base/patterns_01/cmp/generic
new file mode 100644 (file)
index 0000000..eecb03e
--- /dev/null
@@ -0,0 +1,2 @@
+
+DEAL::[Integer range -1...42 (inclusive)]

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.