From 2e2f006cd23b4968da5f07a0e62f777ba2194d37 Mon Sep 17 00:00:00 2001 From: heister Date: Sun, 16 Sep 2012 16:14:51 +0000 Subject: [PATCH] add test for supercolumn output in TableHandler git-svn-id: https://svn.dealii.org/trunk@26404 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/base/table_handler_11.cc | 57 +++++++++++++++++++++++++ tests/base/table_handler_11/cmp/generic | 15 +++++++ 2 files changed, 72 insertions(+) create mode 100644 tests/base/table_handler_11.cc create mode 100644 tests/base/table_handler_11/cmp/generic diff --git a/tests/base/table_handler_11.cc b/tests/base/table_handler_11.cc new file mode 100644 index 0000000000..3611a80252 --- /dev/null +++ b/tests/base/table_handler_11.cc @@ -0,0 +1,57 @@ +//----------------------------------------------------------------------------- +// $Id: table_handler_06.cc 24924 2012-01-25 12:35:17Z kormann $ +// Version: $Name$ +// +// Copyright (C) 2010, 2011 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. +// +//----------------------------------------------------------------------------- + +// test output of supercolumns + + +#include "../tests.h" +#include +#include +#include + +#include +#include +#include +#include + + +int main () +{ + std::ofstream logfile("table_handler_11/output"); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + TableHandler table; + table.set_auto_fill_mode (true); + + std::string keys[] = { "key1", "key2", "key3", "key4", "key5" }; + + table.add_value(keys[0], 0.0); + table.add_value(keys[0], 1.0); + table.add_value(keys[1], 123.456); + table.add_value(keys[2], std::string("abc")); + table.add_value(keys[3], std::string("A")); + table.add_value(keys[4], 123456789.0); + + table.add_column_to_supercolumn("key1","short"); + table.add_column_to_supercolumn("key2","short"); + table.add_column_to_supercolumn("key3","very_long_supercolumn"); + table.add_column_to_supercolumn("key4","very_long_supercolumn"); + + table.write_text(deallog.get_file_stream(), + TableHandler::table_with_separate_column_description); + + table.write_text(deallog.get_file_stream(), + TableHandler::table_with_headers); +} diff --git a/tests/base/table_handler_11/cmp/generic b/tests/base/table_handler_11/cmp/generic new file mode 100644 index 0000000000..e4cc24e56d --- /dev/null +++ b/tests/base/table_handler_11/cmp/generic @@ -0,0 +1,15 @@ + +# 1: key1 +# 2: key2 +# 3: key3 +0.0000 0.0000 "" +1.0000 0.0000 "" +2.0000 123.4560 abc +1.0000 0.0000 "" +# 1: key1 +# 2: key2 +# 3: key3 +0.0000e+00 0.0 "" +1.0000e+00 0.0 "" +2.0000e+00 123.5 abc +1.0000e+00 0.0 "" -- 2.39.5