[cig-commits] r15235 - short/3D/PyLith/trunk/unittests/libtests/materials

brad at geodynamics.org brad at geodynamics.org
Sun Jun 14 07:50:21 PDT 2009


Author: brad
Date: 2009-06-14 07:50:21 -0700 (Sun, 14 Jun 2009)
New Revision: 15235

Modified:
   short/3D/PyLith/trunk/unittests/libtests/materials/TestMaxwellIsotropic3D.cc
Log:
Test if we can compare pointer values.

Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestMaxwellIsotropic3D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestMaxwellIsotropic3D.cc	2009-06-14 04:53:26 UTC (rev 15234)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestMaxwellIsotropic3D.cc	2009-06-14 14:50:21 UTC (rev 15235)
@@ -64,20 +64,26 @@
   MaxwellIsotropic3D material;
 
   material.useElasticBehavior(true);
-  CPPUNIT_ASSERT_EQUAL(&pylith::materials::MaxwellIsotropic3D::_calcStressElastic,
-		       material._calcStressFn);
-  CPPUNIT_ASSERT_EQUAL(&pylith::materials::MaxwellIsotropic3D::_calcElasticConstsElastic,
-		       material._calcElasticConstsFn);
-  CPPUNIT_ASSERT_EQUAL(&pylith::materials::MaxwellIsotropic3D::_updateStateVarsElastic,
-		       material._updateStateVarsFn);
+  
+  // Some compilers/operating systems (cygwin) don't allow comparing
+  // pointers. Use first test to determine if we can compare pointers.
+  if (&pylith::materials::MaxwellIsotropic3D::_calcStressElastic == 
+      material._calcStressFn) {
+    CPPUNIT_ASSERT(&pylith::materials::MaxwellIsotropic3D::_calcStressElastic ==
+		   material._calcStressFn);
+    CPPUNIT_ASSERT(&pylith::materials::MaxwellIsotropic3D::_calcElasticConstsElastic ==
+		   material._calcElasticConstsFn);
+    CPPUNIT_ASSERT(&pylith::materials::MaxwellIsotropic3D::_updateStateVarsElastic ==
+		   material._updateStateVarsFn);
 
-  material.useElasticBehavior(false);
-  CPPUNIT_ASSERT_EQUAL(&pylith::materials::MaxwellIsotropic3D::_calcStressViscoelastic,
-		       material._calcStressFn);
-  CPPUNIT_ASSERT_EQUAL(&pylith::materials::MaxwellIsotropic3D::_calcElasticConstsViscoelastic,
-		       material._calcElasticConstsFn);
-  CPPUNIT_ASSERT_EQUAL(&pylith::materials::MaxwellIsotropic3D::_updateStateVarsViscoelastic,
-		       material._updateStateVarsFn);
+    material.useElasticBehavior(false);
+    CPPUNIT_ASSERT(&pylith::materials::MaxwellIsotropic3D::_calcStressViscoelastic ==
+		   material._calcStressFn);
+    CPPUNIT_ASSERT(&pylith::materials::MaxwellIsotropic3D::_calcElasticConstsViscoelastic ==
+		   material._calcElasticConstsFn);
+    CPPUNIT_ASSERT(&pylith::materials::MaxwellIsotropic3D::_updateStateVarsViscoelastic ==
+		   material._updateStateVarsFn);
+  } // if
 } // testUseElasticBehavior
 
 // ----------------------------------------------------------------------



More information about the CIG-COMMITS mailing list