]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
test Indexset read/write.
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 22 Jun 2010 21:59:31 +0000 (21:59 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 22 Jun 2010 21:59:31 +0000 (21:59 +0000)
git-svn-id: https://svn.dealii.org/trunk@21273 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/index_set_readwrite_01.cc [new file with mode: 0644]
tests/base/index_set_readwrite_01/cmp/generic [new file with mode: 0644]

diff --git a/tests/base/index_set_readwrite_01.cc b/tests/base/index_set_readwrite_01.cc
new file mode 100644 (file)
index 0000000..6d122b0
--- /dev/null
@@ -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 <iomanip>
+#include <iomanip>
+#include <fstream>
+#include <cmath>
+#include <stdlib.h>
+
+#include <base/index_set.h>
+
+
+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 (file)
index 0000000..0fd8fc1
--- /dev/null
@@ -0,0 +1,2 @@
+
+DEAL::OK

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.