--- /dev/null
+//---------------------------- parameter_handler_read_xml_error_02.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_read_xml_error_02.cc ---------------------------
+
+
+// check ParameterHandler::read_input_from_xml. try to read a file that is not
+// valid XML (the last end-tag is missing)
+
+#include "../tests.h"
+#include <base/logstream.h>
+#include <base/parameter_handler.h>
+#include <fstream>
+
+
+int main ()
+{
+ std::ofstream logfile("parameter_handler_read_xml_error_02/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ ParameterHandler prm;
+ prm.declare_entry ("int1",
+ "1",
+ Patterns::Integer(),
+ "doc 1");
+ prm.declare_entry ("int2",
+ "2",
+ Patterns::Integer(),
+ "doc 2");
+ prm.enter_subsection ("ss1");
+ {
+ prm.declare_entry ("double 1",
+ "1.234",
+ Patterns::Double(),
+ "doc 3");
+
+ prm.enter_subsection ("ss2");
+ {
+ prm.declare_entry ("double 2",
+ "4.321",
+ Patterns::Double(),
+ "doc 4");
+ }
+ prm.leave_subsection ();
+ }
+ prm.leave_subsection ();
+
+ // things with strange characters
+ prm.enter_subsection ("Testing%testing");
+ {
+ prm.declare_entry ("string&list",
+ "< & > ; /",
+ Patterns::Anything(),
+ "docs 1");
+ prm.declare_entry ("int*int",
+ "2",
+ Patterns::Integer());
+ prm.declare_entry ("double+double",
+ "6.1415926",
+ Patterns::Double(),
+ "docs 3");
+ }
+ prm.leave_subsection ();
+
+ // read from XML
+ std::ifstream in ("parameter_handler_read_xml_error_02/prm");
+ bool result = prm.read_input_from_xml (in);
+ Assert (result == false, ExcInternalError());
+
+ deallog << "OK" << std::endl;
+
+ return 0;
+}
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+<?xml version="1.0" encoding="utf-8"?>
+<ParameterHandler><int1><value>2</value><default_value>1</default_value><documentation>doc 1</documentation><pattern>0</pattern><pattern_description>[Integer range -2147483648...2147483647 (inclusive)]</pattern_description></int1><int2><value>3</value><default_value>2</default_value><documentation>doc 2</documentation><pattern>1</pattern><pattern_description>[Integer range -2147483648...2147483647 (inclusive)]</pattern_description></int2><ss1><double_201><value>2.234</value><default_value>1.234</default_value><documentation>doc 3</documentation><pattern>2</pattern><pattern_description>[Double -1.79769e+308...1.79769e+308 (inclusive)]</pattern_description></double_201><ss2><double_202><value>5.321</value><default_value>4.321</default_value><documentation>doc 4</documentation><pattern>3</pattern><pattern_description>[Double -1.79769e+308...1.79769e+308 (inclusive)]</pattern_description></double_202></ss2></ss1><Testing_25testing><string_26list><value>__< & > ; /</value><default_value>< & > ; /</default_value><documentation>docs 1</documentation><pattern>4</pattern><pattern_description>[Anything]</pattern_description></string_26list><int_2aint><value>__2</value><default_value>2</default_value><documentation/>
+<pattern>5</pattern><pattern_description>[Integer range -2147483648...2147483647 (inclusive)]</pattern_description></int_2aint><double_2bdouble><value>7.1415926</value><default_value>6.1415926</default_value><documentation>docs 3</documentation><pattern>6</pattern><pattern_description>[Double -1.79769e+308...1.79769e+308 (inclusive)]</pattern_description></double_2bdouble></Testing_25testing>
--- /dev/null
+//---------------------------- parameter_handler_read_xml_error_03.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_read_xml_error_03.cc ---------------------------
+
+
+// check ParameterHandler::read_input_from_xml. try to read a file that is not
+// valid XML (there is more than one top-level element)
+
+#include "../tests.h"
+#include <base/logstream.h>
+#include <base/parameter_handler.h>
+#include <fstream>
+
+
+int main ()
+{
+ std::ofstream logfile("parameter_handler_read_xml_error_03/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ ParameterHandler prm;
+ prm.declare_entry ("int1",
+ "1",
+ Patterns::Integer(),
+ "doc 1");
+ prm.declare_entry ("int2",
+ "2",
+ Patterns::Integer(),
+ "doc 2");
+ prm.enter_subsection ("ss1");
+ {
+ prm.declare_entry ("double 1",
+ "1.234",
+ Patterns::Double(),
+ "doc 3");
+
+ prm.enter_subsection ("ss2");
+ {
+ prm.declare_entry ("double 2",
+ "4.321",
+ Patterns::Double(),
+ "doc 4");
+ }
+ prm.leave_subsection ();
+ }
+ prm.leave_subsection ();
+
+ // things with strange characters
+ prm.enter_subsection ("Testing%testing");
+ {
+ prm.declare_entry ("string&list",
+ "< & > ; /",
+ Patterns::Anything(),
+ "docs 1");
+ prm.declare_entry ("int*int",
+ "2",
+ Patterns::Integer());
+ prm.declare_entry ("double+double",
+ "6.1415926",
+ Patterns::Double(),
+ "docs 3");
+ }
+ prm.leave_subsection ();
+
+ // read from XML
+ std::ifstream in ("parameter_handler_read_xml_error_03/prm");
+ bool result = prm.read_input_from_xml (in);
+ Assert (result == false, ExcInternalError());
+
+ deallog << "OK" << std::endl;
+
+ return 0;
+}
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+<?xml version="1.0" encoding="utf-8"?>
+<ParameterHandler><int1><value>2</value><default_value>1</default_value><documentation>doc 1</documentation><pattern>0</pattern><pattern_description>[Integer range -2147483648...2147483647 (inclusive)]</pattern_description></int1><int2><value>3</value><default_value>2</default_value><documentation>doc 2</documentation><pattern>1</pattern><pattern_description>[Integer range -2147483648...2147483647 (inclusive)]</pattern_description></int2><ss1><double_201><value>2.234</value><default_value>1.234</default_value><documentation>doc 3</documentation><pattern>2</pattern><pattern_description>[Double -1.79769e+308...1.79769e+308 (inclusive)]</pattern_description></double_201><ss2><double_202><value>5.321</value><default_value>4.321</default_value><documentation>doc 4</documentation><pattern>3</pattern><pattern_description>[Double -1.79769e+308...1.79769e+308 (inclusive)]</pattern_description></double_202></ss2></ss1><Testing_25testing><string_26list><value>__< & > ; /</value><default_value>< & > ; /</default_value><documentation>docs 1</documentation><pattern>4</pattern><pattern_description>[Anything]</pattern_description></string_26list><int_2aint><value>__2</value><default_value>2</default_value><documentation/>
+<pattern>5</pattern><pattern_description>[Integer range -2147483648...2147483647 (inclusive)]</pattern_description></int_2aint><double_2bdouble><value>7.1415926</value><default_value>6.1415926</default_value><documentation>docs 3</documentation><pattern>6</pattern><pattern_description>[Double -1.79769e+308...1.79769e+308 (inclusive)]</pattern_description></double_2bdouble></Testing_25testing></ParameterHandler>
+<secondtopleveltag></secondtopleveltag>