From ddd91b6e0510e75e8b85363aa5db8120730775ed Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Mon, 10 Sep 2012 14:26:05 +0000 Subject: [PATCH] test TextOutputFormat::simple_table_with_separate_column_description git-svn-id: https://svn.dealii.org/trunk@26267 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/base/table_handler_09.cc | 55 +++++++++++++++++++++++++ tests/base/table_handler_09/cmp/generic | 8 ++++ 2 files changed, 63 insertions(+) create mode 100644 tests/base/table_handler_09.cc create mode 100644 tests/base/table_handler_09/cmp/generic diff --git a/tests/base/table_handler_09.cc b/tests/base/table_handler_09.cc new file mode 100644 index 0000000000..d176e1e766 --- /dev/null +++ b/tests/base/table_handler_09.cc @@ -0,0 +1,55 @@ +//----------------------------------------------------------------------------- +// $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. +// +//----------------------------------------------------------------------------- + +// use the alternative format for the headers in TableHandler::write_text + + +#include "../tests.h" +#include +#include +#include + +#include +#include +#include +#include + + +int main () +{ + std::ofstream logfile("table_handler_09/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[3] = { "key1", "key2", "key3" }; + + // fill rows 1 and 2 partially + table.add_value(keys[0], 0); + table.add_value(keys[0], 1); + // now fill row 3 completely + table.add_value(keys[0], 2); + table.add_value(keys[1], 113); + table.add_value(keys[2], std::string("a")); + + // now again fill row 4 partially + table.add_value(keys[0], 1); + + // produce output. hope that row 4 is + // completely padded + table.write_text(deallog.get_file_stream(), + TableHandler::simple_table_with_separate_column_description); +} diff --git a/tests/base/table_handler_09/cmp/generic b/tests/base/table_handler_09/cmp/generic new file mode 100644 index 0000000000..b023c8afc9 --- /dev/null +++ b/tests/base/table_handler_09/cmp/generic @@ -0,0 +1,8 @@ + +# 1: key1 +# 2: key2 +# 3: key3 +0 0 "" +1 0 "" +2 113 a +1 0 "" -- 2.39.5