]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Improve test a bit.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 13 Jun 2011 03:21:44 +0000 (03:21 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 13 Jun 2011 03:21:44 +0000 (03:21 +0000)
git-svn-id: https://svn.dealii.org/trunk@23807 0785d39b-7218-0410-832d-ea1e28bc413d

tests/serialization/triangulation_01.cc

index f628faa21f87a1cbfa70038e0a32037bdf2162a3..66800300188e4b38a10d7267241c274f028bd446 100644 (file)
@@ -38,7 +38,7 @@ bool operator == (const Triangulation<dim,spacedim> &t1,
   typename Triangulation<dim,spacedim>::cell_iterator
     c1 = t1.begin(),
     c2 = t2.begin();
-  for (; c1 != t1.end(); ++c1, ++c2)
+  for (; (c1 != t1.end()) && (c2 != t2.end()); ++c1, ++c2)
     {
       for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
        {
@@ -81,6 +81,19 @@ bool operator == (const Triangulation<dim,spacedim> &t1,
        return false;
     }
 
+  // also check the order of raw iterators as they contain
+  // something about the history of the triangulation
+  typename Triangulation<dim,spacedim>::cell_iterator
+    r1 = t1.begin_raw(),
+    r2 = t2.begin_raw();
+  for (; (r1 != t1.end()) && (r2 != t2.end()); ++r1, ++r2)
+  {
+    if (r1->level() != r2->level())
+      return false;
+    if (r1->index() != r2->index())
+      return false;
+  }
+
   return true;
 }
 

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.