From: Wolfgang Bangerth Date: Thu, 8 Jan 2015 07:00:33 +0000 (-0600) Subject: Add a testcase for a recent patch. X-Git-Tag: v8.3.0-rc1~564^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b0e027a0117d3e3709a9d81c47e457283444d42;p=dealii.git Add a testcase for a recent patch. --- diff --git a/tests/base/utilities_08.cc b/tests/base/utilities_08.cc new file mode 100644 index 0000000000..33c7045dd7 --- /dev/null +++ b/tests/base/utilities_08.cc @@ -0,0 +1,53 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2005 - 2013, 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. +// +// --------------------------------------------------------------------- + + +// Utilities::int_to_string produced wrong results with numbers larger +// than 10 digits (including padding) + +#include "../tests.h" +#include +#include +#include +#include + +#include + + +void test () +{ + deallog << Utilities::int_to_string (9,10) << std::endl; + deallog << Utilities::int_to_string (99,10) << std::endl; + deallog << Utilities::int_to_string (999,10) << std::endl; + deallog << Utilities::int_to_string (9999,10) << std::endl; + deallog << Utilities::int_to_string (99999,10) << std::endl; + deallog << Utilities::int_to_string (999999,10) << std::endl; + deallog << Utilities::int_to_string (9999999,10) << std::endl; + deallog << Utilities::int_to_string (99999999,10) << std::endl; + deallog << Utilities::int_to_string (999999999,10) << std::endl; +} + + + + +int main() +{ + std::ofstream logfile("output"); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + test (); +} diff --git a/tests/base/utilities_08.output b/tests/base/utilities_08.output new file mode 100644 index 0000000000..8bb06f426d --- /dev/null +++ b/tests/base/utilities_08.output @@ -0,0 +1,10 @@ + +DEAL::0000000009 +DEAL::0000000099 +DEAL::0000000999 +DEAL::0000009999 +DEAL::0000099999 +DEAL::0000999999 +DEAL::0009999999 +DEAL::0099999999 +DEAL::0999999999