From fe242a246c273f7685af209dd3761fe0c586c982 Mon Sep 17 00:00:00 2001 From: bangerth Date: Tue, 2 Nov 2010 02:52:48 +0000 Subject: [PATCH] Add another test. git-svn-id: https://svn.dealii.org/trunk@22582 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/base/patterns_01.cc | 44 ++++++++++++++++++++++++++++++ tests/base/patterns_01/cmp/generic | 2 ++ 2 files changed, 46 insertions(+) create mode 100644 tests/base/patterns_01.cc create mode 100644 tests/base/patterns_01/cmp/generic diff --git a/tests/base/patterns_01.cc b/tests/base/patterns_01.cc new file mode 100644 index 0000000000..5b926be793 --- /dev/null +++ b/tests/base/patterns_01.cc @@ -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 +#include +#include + +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 index 0000000000..eecb03e441 --- /dev/null +++ b/tests/base/patterns_01/cmp/generic @@ -0,0 +1,2 @@ + +DEAL::[Integer range -1...42 (inclusive)] -- 2.39.5