[cig-commits] r14169 - in short/3D/PyLith/branches/pylith-swig: . unittests/libtests/materials

brad at geodynamics.org brad at geodynamics.org
Fri Feb 27 09:12:27 PST 2009


Author: brad
Date: 2009-02-27 09:12:27 -0800 (Fri, 27 Feb 2009)
New Revision: 14169

Modified:
   short/3D/PyLith/branches/pylith-swig/TODO
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticIsotropic3D.hh
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticPlaneStrain.hh
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticPlaneStress.hh
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticStrain1D.hh
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticStress1D.hh
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestMaterial.cc
   short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestMaterial.hh
Log:
Added libtest for dimension() and tensorSize().

Modified: short/3D/PyLith/branches/pylith-swig/TODO
===================================================================
--- short/3D/PyLith/branches/pylith-swig/TODO	2009-02-27 15:51:57 UTC (rev 14168)
+++ short/3D/PyLith/branches/pylith-swig/TODO	2009-02-27 17:12:27 UTC (rev 14169)
@@ -4,8 +4,6 @@
 
 0. SWIG conversion
 
-  TestMaterial::testTensorSize()
-
   TestMesh.test_view()
   TestMesh.test_checkMaterialIds()
   

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticIsotropic3D.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticIsotropic3D.hh	2009-02-27 15:51:57 UTC (rev 14168)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticIsotropic3D.hh	2009-02-27 17:12:27 UTC (rev 14169)
@@ -37,6 +37,8 @@
   // CPPUNIT TEST SUITE /////////////////////////////////////////////////
   CPPUNIT_TEST_SUITE( TestElasticIsotropic3D );
 
+  CPPUNIT_TEST( testDimension );
+  CPPUNIT_TEST( testTensorSize );
   CPPUNIT_TEST( testDBToProperties );
   CPPUNIT_TEST( testNonDimProperties );
   CPPUNIT_TEST( testDimProperties );

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticPlaneStrain.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticPlaneStrain.hh	2009-02-27 15:51:57 UTC (rev 14168)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticPlaneStrain.hh	2009-02-27 17:12:27 UTC (rev 14169)
@@ -37,6 +37,8 @@
   // CPPUNIT TEST SUITE /////////////////////////////////////////////////
   CPPUNIT_TEST_SUITE( TestElasticPlaneStrain );
 
+  CPPUNIT_TEST( testDimension );
+  CPPUNIT_TEST( testTensorSize );
   CPPUNIT_TEST( testDBToProperties );
   CPPUNIT_TEST( testNonDimProperties );
   CPPUNIT_TEST( testDimProperties );

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticPlaneStress.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticPlaneStress.hh	2009-02-27 15:51:57 UTC (rev 14168)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticPlaneStress.hh	2009-02-27 17:12:27 UTC (rev 14169)
@@ -37,6 +37,8 @@
   // CPPUNIT TEST SUITE /////////////////////////////////////////////////
   CPPUNIT_TEST_SUITE( TestElasticPlaneStress );
 
+  CPPUNIT_TEST( testDimension );
+  CPPUNIT_TEST( testTensorSize );
   CPPUNIT_TEST( testDBToProperties );
   CPPUNIT_TEST( testNonDimProperties );
   CPPUNIT_TEST( testDimProperties );

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticStrain1D.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticStrain1D.hh	2009-02-27 15:51:57 UTC (rev 14168)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticStrain1D.hh	2009-02-27 17:12:27 UTC (rev 14169)
@@ -37,6 +37,8 @@
   // CPPUNIT TEST SUITE /////////////////////////////////////////////////
   CPPUNIT_TEST_SUITE( TestElasticStrain1D );
 
+  CPPUNIT_TEST( testDimension );
+  CPPUNIT_TEST( testTensorSize );
   CPPUNIT_TEST( testDBToProperties );
   CPPUNIT_TEST( testNonDimProperties );
   CPPUNIT_TEST( testDimProperties );

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticStress1D.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticStress1D.hh	2009-02-27 15:51:57 UTC (rev 14168)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestElasticStress1D.hh	2009-02-27 17:12:27 UTC (rev 14169)
@@ -37,6 +37,8 @@
   // CPPUNIT TEST SUITE /////////////////////////////////////////////////
   CPPUNIT_TEST_SUITE( TestElasticStress1D );
 
+  CPPUNIT_TEST( testDimension );
+  CPPUNIT_TEST( testTensorSize );
   CPPUNIT_TEST( testDBToProperties );
   CPPUNIT_TEST( testNonDimProperties );
   CPPUNIT_TEST( testDimProperties );

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestMaterial.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestMaterial.cc	2009-02-27 15:51:57 UTC (rev 14168)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestMaterial.cc	2009-02-27 17:12:27 UTC (rev 14169)
@@ -282,6 +282,32 @@
 } // testDimension
 
 // ----------------------------------------------------------------------
+// Test dimension()
+void
+pylith::materials::TestMaterial::testTensorSize(void)
+{ // testTensorSize
+  int tensorSize = 0;
+  const int dimension = _data->dimension;
+  switch(dimension)
+    { // switch
+    case 1 :
+      tensorSize = 1;
+      break;
+    case 2 :
+      tensorSize = 3;
+      break;
+    case 3 :
+      tensorSize = 6;
+      break;
+    default :
+      assert(0);
+    } // switch
+  CPPUNIT_ASSERT(tensorSize > 0);
+
+  CPPUNIT_ASSERT_EQUAL(tensorSize, _material->tensorSize());
+} // testTensorSize
+
+// ----------------------------------------------------------------------
 // Test _dbToProperties().
 void
 pylith::materials::TestMaterial::testDBToProperties(void)

Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestMaterial.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestMaterial.hh	2009-02-27 15:51:57 UTC (rev 14168)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/materials/TestMaterial.hh	2009-02-27 17:12:27 UTC (rev 14169)
@@ -94,6 +94,9 @@
   /// Test dimension().
   void testDimension();
 
+  /// Test tensorSize().
+  void testTensorSize();
+
   /// Test _dbToProperties().
   void testDBToProperties(void);
 



More information about the CIG-COMMITS mailing list