]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Convert tests to use ParameterHandler::parse_input().
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 24 Apr 2017 17:20:56 +0000 (11:20 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 24 Apr 2017 17:20:56 +0000 (11:20 -0600)
This test also requires not to use the old semantics of creating
input files that don't exist.

tests/parameter_handler/parameter_handler_14.cc

index 1b82b822537e03ed967a0a013db124c922dd188b..ee990262556f2ede9411583a2d635e5765c7d95c 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2002 - 2016 by the deal.II authors
+// Copyright (C) 2002 - 2017 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
 
 void check ()
 {
+  std::string input = "subsection bar\n"
+                      "  set value = 1.0\n"
+                      "end\n";
+
   ParameterHandler foo;
   foo.enter_subsection("bar");
   foo.declare_entry("value", "1.0", dealii::Patterns::Double(), "");
@@ -33,7 +37,7 @@ void check ()
 
   try
     {
-      foo.parse_input("tmp.prm");
+      foo.parse_input_from_string(input.c_str());
     }
   catch (...)
     {
@@ -44,9 +48,6 @@ void check ()
   foo.enter_subsection("bar");
   deallog << foo.get ("value") << std::endl;
   foo.leave_subsection();
-
-  // delete tmp file again
-  std::remove("tmp.prm");
 }
 
 

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.