From: weiler Date: Fri, 27 Aug 2010 15:28:39 +0000 (+0000) Subject: new test X-Git-Tag: v8.0.0~5646 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad6859c1fd9949829bee26b1eea17b6f0c9e029b;p=dealii.git new test git-svn-id: https://svn.dealii.org/trunk@21752 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/Makefile b/tests/base/Makefile index c657cb1143..08127dedd9 100644 --- a/tests/base/Makefile +++ b/tests/base/Makefile @@ -72,6 +72,7 @@ tests_x = geometry_info_* \ named_data \ slice_vector \ table \ + table_handler* \ tensor \ tensor_* \ point_* \ diff --git a/tests/base/table_handler_01.cc b/tests/base/table_handler_01.cc new file mode 100644 index 0000000000..bb88649e26 --- /dev/null +++ b/tests/base/table_handler_01.cc @@ -0,0 +1,56 @@ +//----------------------------------------------------------------------------- +// $Id: table_handler_01.cc 20952 2010-04-06 15:02:46Z bangerth $ +// Version: $Name$ +// +// Copyright (C) 2010 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. +// +//----------------------------------------------------------------------------- + +#include "../tests.h" +#include +#include +#include + +#include +#include +#include +#include + +// test the method set_tex_table_caption +// it creates a caption for the whole table + +int main () +{ + std::ofstream logfile("table_handler_01/output"); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + TableHandler table; + + for (unsigned int i=1; i<=10; ++i) + { + table.add_value("numbers", i); + table.add_value("squares", i*i); + table.add_value("square roots", sqrt(i)); + } + + table.set_tex_table_caption("This is a caption text with \\LaTeX{} symbols"); + + // output + std::ofstream out("table_handler_01/outfile.tex"); + table.write_tex(out); + std::ifstream in("table_handler_01/outfile.tex"); + while (in) + { + std::string s; + std::getline(in, s); + deallog.get_file_stream() << s << "\n"; + } + +} diff --git a/tests/base/table_handler_01/cmp/generic b/tests/base/table_handler_01/cmp/generic new file mode 100644 index 0000000000..e5b155659c --- /dev/null +++ b/tests/base/table_handler_01/cmp/generic @@ -0,0 +1,26 @@ + +\documentclass[10pt]{report} +\usepackage{float} + + +\begin{document} +\begin{table}[H] +\begin{center} +\begin{tabular}{|c|c|c|} \hline +numbers & squares & square roots\\ \hline +1 & 1 & 1.0000\\ \hline +2 & 4 & 1.4142\\ \hline +3 & 9 & 1.7321\\ \hline +4 & 16 & 2.0000\\ \hline +5 & 25 & 2.2361\\ \hline +6 & 36 & 2.4495\\ \hline +7 & 49 & 2.6458\\ \hline +8 & 64 & 2.8284\\ \hline +9 & 81 & 3.0000\\ \hline +10 & 100 & 3.1623\\ \hline +\end{tabular} +\end{center} +\caption{This is a caption text with \LaTeX{} symbols} +\end{table} +\end{document} +