[cig-commits] r11312 - short/3D/PyLith/trunk/unittests/libtests/feassemble

brad at geodynamics.org brad at geodynamics.org
Mon Mar 3 16:37:37 PST 2008


Author: brad
Date: 2008-03-03 16:37:37 -0800 (Mon, 03 Mar 2008)
New Revision: 11312

Modified:
   short/3D/PyLith/trunk/unittests/libtests/feassemble/TestCellGeometry.cc
Log:
Relaxed test of orientFn to not require equal addresses for the function pointers. Address values may depend on how function is resolved.

Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestCellGeometry.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestCellGeometry.cc	2008-03-04 00:33:56 UTC (rev 11311)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestCellGeometry.cc	2008-03-04 00:37:37 UTC (rev 11312)
@@ -194,22 +194,24 @@
 { // testOrientFn
   CPPUNIT_ASSERT(0 != _object);
   CPPUNIT_ASSERT(0 != _data);
+
+  // We can't compare function pointers, because they depend on how
+  // the dynamic library is loaded (seems okay on Linux and Darwin but
+  // fails with cygwin). Instead we settle for making sure the
+  // function pointer is not 0 (NULL).
+
   switch (_data->cellDim)
     { // switch
     case 0 :
-      CPPUNIT_ASSERT(CellGeometry::_orient0D == _object->_orientFn);
-      break;
     case 1 :
-      CPPUNIT_ASSERT(CellGeometry::_orient1D == _object->_orientFn);
-      break;
     case 2 :
-      CPPUNIT_ASSERT(CellGeometry::_orient2D == _object->_orientFn);
+      CPPUNIT_ASSERT(0 != _object->_orientFn);
       break;
     case 3 :
       CPPUNIT_ASSERT(0 == _object->_orientFn);
       break;
     default :
-      assert(0);
+      CPPUNIT_ASSERT(0);
     } // switch
 } // testOrientFn
 



More information about the cig-commits mailing list