From fa8a251332a615b98dd1eada19c39106efe654ba Mon Sep 17 00:00:00 2001 From: bangerth Date: Sat, 21 Dec 2013 13:17:28 +0000 Subject: [PATCH] Add new test. git-svn-id: https://svn.dealii.org/trunk@32077 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/base/boost_iostreams_01.cc | 63 ++++++++++++++++++++++++++ tests/base/boost_iostreams_01.data.gz | Bin 0 -> 55 bytes tests/base/boost_iostreams_01.output | 2 + 3 files changed, 65 insertions(+) create mode 100644 tests/base/boost_iostreams_01.cc create mode 100644 tests/base/boost_iostreams_01.data.gz create mode 100644 tests/base/boost_iostreams_01.output 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 0000000000000000000000000000000000000000..37314c4f1d9c577e13043cdac576a4086e455168 GIT binary patch literal 55 zcmb2|=HS@bwl#=>IVnHCxFkLkNED?e<`%~r80w`YmLxJ58wMF%Gd3|a+4_Wu;a=pU JY1|A93;-NI62<@k literal 0 HcmV?d00001 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 -- 2.39.5