From: heister Date: Tue, 22 Jun 2010 21:59:31 +0000 (+0000) Subject: test Indexset read/write. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0e7224080d778a7104ddbfb3bfbf17ee86ddc5d;p=dealii-svn.git test Indexset read/write. git-svn-id: https://svn.dealii.org/trunk@21273 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/index_set_readwrite_01.cc b/tests/base/index_set_readwrite_01.cc new file mode 100644 index 0000000000..6d122b090b --- /dev/null +++ b/tests/base/index_set_readwrite_01.cc @@ -0,0 +1,63 @@ +//----------------------------------------------------------------------------- +// $Id: index_set_15.cc 20519 2010-02-08 10:23:05Z heister $ +// 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. +// +//----------------------------------------------------------------------------- + +// test IndexSet::read() and write() + +#include "../tests.h" +#include +#include +#include +#include +#include + +#include + + +void test () +{ + IndexSet is1 (100); + + is1.add_range(0,10); + is1.add_range(20,100); + + std::ofstream out("index_set_readwrite_01/a.idxset"); + is1.write(out); + IndexSet is2; + std::ifstream in("index_set_readwrite_01/a.idxset"); + is2.read(in); + + Assert(is1 == is2, ExcInternalError()); + + + IndexSet is3(11); + is3.add_range(3,5); + std::ifstream in2("index_set_readwrite_01/a.idxset"); + is3.read(in2); + + Assert(is1 == is3, ExcInternalError()); + + deallog << "OK" << std::endl; +} + + + + +int main() +{ + std::ofstream logfile("index_set_readwrite_01/output"); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + test (); +} diff --git a/tests/base/index_set_readwrite_01/cmp/generic b/tests/base/index_set_readwrite_01/cmp/generic new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/base/index_set_readwrite_01/cmp/generic @@ -0,0 +1,2 @@ + +DEAL::OK