[cig-commits] r20088 - in short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults: . data
brad at geodynamics.org
brad at geodynamics.org
Fri May 11 16:03:25 PDT 2012
Author: brad
Date: 2012-05-11 16:03:24 -0700 (Fri, 11 May 2012)
New Revision: 20088
Modified:
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveDyn.cc
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveDynDataHex8.cc
Log:
Fixed memory bug in C++ unit test (missing initialization and deallocation).
Modified: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveDyn.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveDyn.cc 2012-05-11 23:00:45 UTC (rev 20087)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveDyn.cc 2012-05-11 23:03:24 UTC (rev 20088)
@@ -56,6 +56,7 @@
_quadrature = new feassemble::Quadrature<topology::SubMesh>();
CPPUNIT_ASSERT(0 != _quadrature);
_tractPerturbation = 0;
+ _dbInitialTract = 0;
_friction = 0;
_dbFriction = 0;
_flipFault = false;
@@ -69,6 +70,7 @@
delete _data; _data = 0;
delete _quadrature; _quadrature = 0;
delete _tractPerturbation; _tractPerturbation = 0;
+ delete _dbInitialTract; _dbInitialTract = 0;
delete _friction; _friction = 0;
delete _dbFriction; _dbFriction = 0;
} // tearDown
@@ -698,16 +700,15 @@
// ----------------------------------------------------------------------
// Initialize FaultCohesiveDyn interface condition.
void
-pylith::faults::TestFaultCohesiveDyn::_initialize(
- topology::Mesh* const mesh,
- FaultCohesiveDyn* const fault,
- topology::SolutionFields* const fields)
+pylith::faults::TestFaultCohesiveDyn::_initialize(topology::Mesh* const mesh,
+ FaultCohesiveDyn* const fault,
+ topology::SolutionFields* const fields)
{ // _initialize
- CPPUNIT_ASSERT(0 != mesh);
- CPPUNIT_ASSERT(0 != fault);
- CPPUNIT_ASSERT(0 != fields);
- CPPUNIT_ASSERT(0 != _data);
- CPPUNIT_ASSERT(0 != _quadrature);
+ CPPUNIT_ASSERT(mesh);
+ CPPUNIT_ASSERT(fault);
+ CPPUNIT_ASSERT(fields);
+ CPPUNIT_ASSERT(_data);
+ CPPUNIT_ASSERT(_quadrature);
meshio::MeshIOAscii iohandler;
iohandler.filename(_data->meshFilename);
Modified: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveDynDataHex8.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveDynDataHex8.cc 2012-05-11 23:00:45 UTC (rev 20087)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveDynDataHex8.cc 2012-05-11 23:03:24 UTC (rev 20088)
@@ -1356,7 +1356,7 @@
// Stick case
// ----------------------------------------------------------------------
// Input
-const PylithScalar pylith::faults::CohesiveDynDataHex8::_fieldIncrStick[] = {
+const PylithScalar pylith::faults::CohesiveDynDataHex8::_fieldIncrStick[20*3] = {
0.1, 2.1, 1.1,
0.2, 2.2, 1.2,
0.3, 2.3, 1.3,
@@ -1391,7 +1391,7 @@
// Slip case
// ----------------------------------------------------------------------
// Input
-const PylithScalar pylith::faults::CohesiveDynDataHex8::_fieldIncrSlip[] = {
+const PylithScalar pylith::faults::CohesiveDynDataHex8::_fieldIncrSlip[20*3] = {
1.1, 2.1, 0.1,
1.2, 2.2, 0.2,
1.3, 2.3, 0.3,
@@ -1415,7 +1415,7 @@
};
// Output
-const PylithScalar pylith::faults::CohesiveDynDataHex8::_fieldIncrSlipE[] = {
+const PylithScalar pylith::faults::CohesiveDynDataHex8::_fieldIncrSlipE[20*3] = {
1.100000000000, 2.100000000000, 0.100000000000,
1.200000000000, 2.200000000000, 0.200000000000,
1.300000000000, 2.300000000000, 0.300000000000,
More information about the CIG-COMMITS
mailing list