From: Wolfgang Bangerth Date: Sat, 21 Dec 2013 13:17:28 +0000 (+0000) Subject: Add new test. X-Git-Tag: v8.2.0-rc1~1148 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7a640235544d229ffd593559faa917b0a469173;p=dealii.git Add new test. git-svn-id: https://svn.dealii.org/trunk@32077 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/boost_iostreams_01.cc b/tests/base/boost_iostreams_01.cc new file mode 100644 index 0000000000..5686ca73a8 --- /dev/null +++ b/tests/base/boost_iostreams_01.cc @@ -0,0 +1,63 @@ +// --------------------------------------------------------------------- +// $Id$ +// +// Copyright (C) 2013 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 that we can use BOOST iostreams + +#include "../tests.h" +#include +#include +#include +#include + +#include +#include +#include + + +void test () +{ + // create a stream where we read from gzipped data + boost::iostreams::filtering_istream in; + in.push(boost::iostreams::basic_gzip_decompressor<>()); + in.push(boost::iostreams::file_source(SOURCE_DIR "/boost_iostreams_01.data.gz")); + AssertThrow (in, ExcIO()); + + // read the two numbers that are in this file + int i; + double d; + in >> i >> d; + + deallog << i << ' ' << d << std::endl; + + // make sure that we got here just fine but that there is nothing else + AssertThrow (in, ExcIO()); + in >> i; + AssertThrow (!in, ExcIO()); +} + + + + +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/boost_iostreams_01.data.gz b/tests/base/boost_iostreams_01.data.gz new file mode 100644 index 0000000000..37314c4f1d Binary files /dev/null and b/tests/base/boost_iostreams_01.data.gz differ diff --git a/tests/base/boost_iostreams_01.output b/tests/base/boost_iostreams_01.output new file mode 100644 index 0000000000..f8a3022226 --- /dev/null +++ b/tests/base/boost_iostreams_01.output @@ -0,0 +1,2 @@ + +DEAL::42 3.14159