]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
New test.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 10 Oct 2009 02:34:59 +0000 (02:34 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 10 Oct 2009 02:34:59 +0000 (02:34 +0000)
git-svn-id: https://svn.dealii.org/trunk@19799 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/index_set_04.cc [new file with mode: 0644]
tests/base/index_set_04/cmp/generic [new file with mode: 0644]
tests/base/index_set_04/cmp/powerpc-apple-darwin8.10.0+gcc4.0 [new file with mode: 0644]
tests/base/index_set_04/cmp/powerpc-apple-darwin8.8.0+gcc4.0 [new file with mode: 0644]

diff --git a/tests/base/index_set_04.cc b/tests/base/index_set_04.cc
new file mode 100644 (file)
index 0000000..e8aa969
--- /dev/null
@@ -0,0 +1,59 @@
+//-----------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2009 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::is_contiguous and compress()
+
+#include "../tests.h"
+#include <iomanip>
+#include <iomanip>
+#include <fstream>
+#include <cmath>
+
+#include <base/index_set.h>
+
+
+void test ()
+{
+  IndexSet index_set (10);
+  index_set.add_index (2);
+  index_set.add_index (3);
+  index_set.add_index (4);
+
+  index_set.compress ();
+
+  index_set.add_index (5);
+
+  index_set.add_index (6);
+  index_set.add_index (7);
+
+  deallog << (index_set.is_contiguous() ? "true" : "false")
+         << std::endl;
+  Assert (index_set.is_contiguous() == true, ExcInternalError());
+
+  for (unsigned int i=0; i<index_set.size(); ++i)
+    deallog << i << ' ' << (index_set.is_element(i) ? "true" : "false")
+           << std::endl;
+}
+
+
+
+
+int main()
+{
+  std::ofstream logfile("index_set_04/output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  test ();
+}
diff --git a/tests/base/index_set_04/cmp/generic b/tests/base/index_set_04/cmp/generic
new file mode 100644 (file)
index 0000000..381193b
--- /dev/null
@@ -0,0 +1,12 @@
+
+DEAL::true
+DEAL::0 false
+DEAL::1 false
+DEAL::2 true
+DEAL::3 true
+DEAL::4 true
+DEAL::5 true
+DEAL::6 true
+DEAL::7 true
+DEAL::8 false
+DEAL::9 false
diff --git a/tests/base/index_set_04/cmp/powerpc-apple-darwin8.10.0+gcc4.0 b/tests/base/index_set_04/cmp/powerpc-apple-darwin8.10.0+gcc4.0
new file mode 100644 (file)
index 0000000..902f619
--- /dev/null
@@ -0,0 +1,9 @@
+
+DEAL::0042
+DEAL::42
+DEAL::3
+DEAL::413
+DEAL::1
+DEAL::-12
+DEAL::125
+DEAL::-177.002 -36.2427 43.4584 
diff --git a/tests/base/index_set_04/cmp/powerpc-apple-darwin8.8.0+gcc4.0 b/tests/base/index_set_04/cmp/powerpc-apple-darwin8.8.0+gcc4.0
new file mode 100644 (file)
index 0000000..902f619
--- /dev/null
@@ -0,0 +1,9 @@
+
+DEAL::0042
+DEAL::42
+DEAL::3
+DEAL::413
+DEAL::1
+DEAL::-12
+DEAL::125
+DEAL::-177.002 -36.2427 43.4584 

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.