From f4f6a4b49c4d6d2161a365e997b724edfd17c043 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 8 Sep 2010 14:24:38 +0000 Subject: [PATCH] New test. git-svn-id: https://svn.dealii.org/trunk@21880 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/bits/parameter_handler_12.cc | 43 +++++++++++++++++++++ tests/bits/parameter_handler_12/cmp/generic | 3 ++ tests/bits/parameter_handler_12/prm | 1 + 3 files changed, 47 insertions(+) create mode 100644 tests/bits/parameter_handler_12.cc create mode 100644 tests/bits/parameter_handler_12/cmp/generic create mode 100644 tests/bits/parameter_handler_12/prm diff --git a/tests/bits/parameter_handler_12.cc b/tests/bits/parameter_handler_12.cc new file mode 100644 index 0000000000..acc944571d --- /dev/null +++ b/tests/bits/parameter_handler_12.cc @@ -0,0 +1,43 @@ +//---------------------------- parameter_handler_12.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2002, 2003, 2004, 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. +// +//---------------------------- parameter_handler_12.cc --------------------------- + + +// testing reading a parameter that doesn't conform to its specs. this +// incidentally also uncovered a bug in Patterns::Integer::match + +#include "../tests.h" +#include +#include +#include + +void check () +{ + ParameterHandler prm; + prm.declare_entry ("test_1", "3", Patterns::Integer()); + + prm.set ("test_1", "3.1415"); + deallog << "test_1=" << prm.get ("test_1") << std::endl; +} + + +int main () +{ + std::ofstream logfile("parameter_handler_12/output"); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + check (); + + return 0; +} diff --git a/tests/bits/parameter_handler_12/cmp/generic b/tests/bits/parameter_handler_12/cmp/generic new file mode 100644 index 0000000000..cbd1572054 --- /dev/null +++ b/tests/bits/parameter_handler_12/cmp/generic @@ -0,0 +1,3 @@ + +DEAL::0 +DEAL::test_1=3 diff --git a/tests/bits/parameter_handler_12/prm b/tests/bits/parameter_handler_12/prm new file mode 100644 index 0000000000..717e46d2ad --- /dev/null +++ b/tests/bits/parameter_handler_12/prm @@ -0,0 +1 @@ +set test_1 = 3.1415 -- 2.39.5