]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Test tex output.
authorLuca Heltai <luca.heltai@sissa.it>
Wed, 20 Sep 2017 10:05:59 +0000 (12:05 +0200)
committerLuca Heltai <luca.heltai@sissa.it>
Tue, 26 Sep 2017 17:19:24 +0000 (19:19 +0200)
tests/parameter_handler/parameter_acceptor_06.cc [new file with mode: 0644]
tests/parameter_handler/parameter_acceptor_06.output [new file with mode: 0644]

diff --git a/tests/parameter_handler/parameter_acceptor_06.cc b/tests/parameter_handler/parameter_acceptor_06.cc
new file mode 100644 (file)
index 0000000..5353ae0
--- /dev/null
@@ -0,0 +1,78 @@
+//-----------------------------------------------------------
+//
+//    Copyright (C) 2015 by the deal.II authors
+//
+//    This file is part of the deal.II library.
+//
+//    The deal.II library is free software; you can use it, redistribute
+//    it, and/or modify it under the terms of the GNU Lesser General
+//    Public License as published by the Free Software Foundation; either
+//    version 2.1 of the License, or (at your option) any later version.
+//    The full text of the license can be found in the file LICENSE at
+//    the top level of the deal.II distribution.
+//
+//-----------------------------------------------------------
+
+
+
+#include "../tests.h"
+#include <deal.II/base/path_search.h>
+#include <deal.II/base/utilities.h>
+#include <deal.II/base/parameter_acceptor.h>
+
+class FirstClass : public ParameterAcceptor
+{
+public:
+  FirstClass(const std::string &name = "First Class"):
+    ParameterAcceptor(name)
+  {
+    add_parameter("First int",   f_i);
+    add_parameter("First double",f_d);
+    add_parameter("First bool",  f_b);
+    add_parameter("First string",f_s);
+  };
+
+private:
+  int         f_i = 3;
+  double      f_d = 7.7;
+  bool        f_b = true;
+  std::string f_s = "hello";
+};
+
+class SecondClass : public ParameterAcceptor
+{
+public:
+  SecondClass(const std::string &name = "Second Class"):
+    ParameterAcceptor(name)
+  {
+    add_parameter("Second int",   s_i);
+    add_parameter("Second double",s_d);
+    add_parameter("Second bool",  s_b);
+    add_parameter("Second string",s_s);
+  };
+
+private:
+  int         s_i = 5;
+  double      s_d = 9.9;
+  bool        s_b = false;
+  std::string s_s = "bye bye";
+};
+
+int main ()
+{
+  initlog();
+
+  FirstClass  f;
+  SecondClass s;
+  std::string output_name = "used_parameter_acceptor_06.tex";
+  ParameterAcceptor::initialize(SOURCE_DIR "/parameter_acceptor_parameters/parameter_acceptor_05.prm", output_name);
+  ParameterAcceptor::prm.log_parameters(deallog);
+  std::ifstream file (output_name.c_str());
+
+  std::string str;
+  deallog << "reading " << output_name << std::endl;
+  while (std::getline(file, str))
+    deallog << str << std::endl;
+
+
+}
diff --git a/tests/parameter_handler/parameter_acceptor_06.output b/tests/parameter_handler/parameter_acceptor_06.output
new file mode 100644 (file)
index 0000000..a29b7b4
--- /dev/null
@@ -0,0 +1,130 @@
+
+DEAL:parameters:First Class::First bool: true
+DEAL:parameters:First Class::First double: 7.7
+DEAL:parameters:First Class::First int: 3
+DEAL:parameters:First Class::First string: hello
+DEAL:parameters:Second Class::Second bool: false
+DEAL:parameters:Second Class::Second double: 9.9
+DEAL:parameters:Second Class::Second int: 5
+DEAL:parameters:Second Class::Second string: bye bye
+DEAL::reading used_parameter_acceptor_06.tex
+DEAL::\subsection{Global parameters}
+DEAL::\label{parameters:global}
+DEAL::
+DEAL::
+DEAL::
+DEAL::\subsection{Parameters in section \tt First Class}
+DEAL::\label{parameters:First_20Class}
+DEAL::
+DEAL::\begin{itemize}
+DEAL::\item {\it Parameter name:} {\tt First bool}
+DEAL::\phantomsection\label{parameters:First Class/First bool}
+DEAL::
+DEAL::
+DEAL::\index[prmindex]{First bool}
+DEAL::\index[prmindexfull]{First Class!First bool}
+DEAL::{\it Value:} true
+DEAL::
+DEAL::
+DEAL::{\it Default:} true
+DEAL::
+DEAL::
+DEAL::{\it Possible values:} A boolean value (true or false)
+DEAL::\item {\it Parameter name:} {\tt First double}
+DEAL::\phantomsection\label{parameters:First Class/First double}
+DEAL::
+DEAL::
+DEAL::\index[prmindex]{First double}
+DEAL::\index[prmindexfull]{First Class!First double}
+DEAL::{\it Value:} 7.7
+DEAL::
+DEAL::
+DEAL::{\it Default:} 7.700000
+DEAL::
+DEAL::
+DEAL::{\it Possible values:} A floating point number $v$ such that $-\text{MAX\_DOUBLE} \leq v \leq \text{MAX\_DOUBLE}$
+DEAL::\item {\it Parameter name:} {\tt First int}
+DEAL::\phantomsection\label{parameters:First Class/First int}
+DEAL::
+DEAL::
+DEAL::\index[prmindex]{First int}
+DEAL::\index[prmindexfull]{First Class!First int}
+DEAL::{\it Value:} 3
+DEAL::
+DEAL::
+DEAL::{\it Default:} 3
+DEAL::
+DEAL::
+DEAL::{\it Possible values:} An integer $n$ such that $-2147483648\leq n \leq 2147483647$
+DEAL::\item {\it Parameter name:} {\tt First string}
+DEAL::\phantomsection\label{parameters:First Class/First string}
+DEAL::
+DEAL::
+DEAL::\index[prmindex]{First string}
+DEAL::\index[prmindexfull]{First Class!First string}
+DEAL::{\it Value:} hello
+DEAL::
+DEAL::
+DEAL::{\it Default:} hello
+DEAL::
+DEAL::
+DEAL::{\it Possible values:} Any string
+DEAL::\end{itemize}
+DEAL::
+DEAL::\subsection{Parameters in section \tt Second Class}
+DEAL::\label{parameters:Second_20Class}
+DEAL::
+DEAL::\begin{itemize}
+DEAL::\item {\it Parameter name:} {\tt Second bool}
+DEAL::\phantomsection\label{parameters:Second Class/Second bool}
+DEAL::
+DEAL::
+DEAL::\index[prmindex]{Second bool}
+DEAL::\index[prmindexfull]{Second Class!Second bool}
+DEAL::{\it Value:} false
+DEAL::
+DEAL::
+DEAL::{\it Default:} false
+DEAL::
+DEAL::
+DEAL::{\it Possible values:} A boolean value (true or false)
+DEAL::\item {\it Parameter name:} {\tt Second double}
+DEAL::\phantomsection\label{parameters:Second Class/Second double}
+DEAL::
+DEAL::
+DEAL::\index[prmindex]{Second double}
+DEAL::\index[prmindexfull]{Second Class!Second double}
+DEAL::{\it Value:} 9.9
+DEAL::
+DEAL::
+DEAL::{\it Default:} 9.900000
+DEAL::
+DEAL::
+DEAL::{\it Possible values:} A floating point number $v$ such that $-\text{MAX\_DOUBLE} \leq v \leq \text{MAX\_DOUBLE}$
+DEAL::\item {\it Parameter name:} {\tt Second int}
+DEAL::\phantomsection\label{parameters:Second Class/Second int}
+DEAL::
+DEAL::
+DEAL::\index[prmindex]{Second int}
+DEAL::\index[prmindexfull]{Second Class!Second int}
+DEAL::{\it Value:} 5
+DEAL::
+DEAL::
+DEAL::{\it Default:} 5
+DEAL::
+DEAL::
+DEAL::{\it Possible values:} An integer $n$ such that $-2147483648\leq n \leq 2147483647$
+DEAL::\item {\it Parameter name:} {\tt Second string}
+DEAL::\phantomsection\label{parameters:Second Class/Second string}
+DEAL::
+DEAL::
+DEAL::\index[prmindex]{Second string}
+DEAL::\index[prmindexfull]{Second Class!Second string}
+DEAL::{\it Value:} bye bye
+DEAL::
+DEAL::
+DEAL::{\it Default:} bye bye
+DEAL::
+DEAL::
+DEAL::{\it Possible values:} Any string
+DEAL::\end{itemize}

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.