]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add test.
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 11 Apr 2017 21:52:10 +0000 (15:52 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 12 Apr 2017 15:19:31 +0000 (09:19 -0600)
tests/base/table_handler_15.cc [new file with mode: 0644]
tests/base/table_handler_15.output [new file with mode: 0644]

diff --git a/tests/base/table_handler_15.cc b/tests/base/table_handler_15.cc
new file mode 100644 (file)
index 0000000..c6ffaeb
--- /dev/null
@@ -0,0 +1,48 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2017 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.
+//
+// ---------------------------------------------------------------------
+
+
+// test TableHandler::declare_column()
+
+
+#include "../tests.h"
+#include <deal.II/base/data_out_base.h>
+#include <deal.II/base/table_handler.h>
+#include <deal.II/base/logstream.h>
+
+#include <vector>
+#include <iomanip>
+#include <fstream>
+#include <string>
+
+
+int main ()
+{
+  initlog ();
+
+  TableHandler table;
+
+  // declare columns either directly, or by adding a value
+  table.declare_column ("key1");
+  table.add_value("key2", 0);
+  table.declare_column ("key3");
+
+  // finish that row (even though there is something only in column 2)
+  // and output the whole shebang
+  table.start_new_row ();
+
+  table.write_text(deallog.get_file_stream(),
+                   TableHandler::org_mode_table);
+}
diff --git a/tests/base/table_handler_15.output b/tests/base/table_handler_15.output
new file mode 100644 (file)
index 0000000..746ed26
--- /dev/null
@@ -0,0 +1,3 @@
+
+| key1 | key2 | key3 | 
+| ""   | 0    | ""   | 

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.