[cig-commits] r13059 - cs/cigma/trunk/tests/libcigma
luis at geodynamics.org
luis at geodynamics.org
Wed Oct 15 02:08:03 PDT 2008
Author: luis
Date: 2008-10-15 02:08:02 -0700 (Wed, 15 Oct 2008)
New Revision: 13059
Modified:
cs/cigma/trunk/tests/libcigma/NodeCoordinatesTest.cpp
cs/cigma/trunk/tests/libcigma/NodeCoordinatesTest.h
Log:
Test for nc_array constructor
Modified: cs/cigma/trunk/tests/libcigma/NodeCoordinatesTest.cpp
===================================================================
--- cs/cigma/trunk/tests/libcigma/NodeCoordinatesTest.cpp 2008-10-15 09:08:01 UTC (rev 13058)
+++ cs/cigma/trunk/tests/libcigma/NodeCoordinatesTest.cpp 2008-10-15 09:08:02 UTC (rev 13059)
@@ -1,9 +1,10 @@
#include "NodeCoordinatesTest.h"
+#include <boost/smart_ptr.hpp>
+#include "Exception.h"
#include "NodeCoordinates.h"
-#include "Exception.h"
+#include "nc_array.h"
-#include <boost/smart_ptr.hpp>
using namespace libcigma;
@@ -14,7 +15,7 @@
NodeCoordinatesTest::NodeCoordinatesTest() {}
NodeCoordinatesTest::~NodeCoordinatesTest() {}
-void NodeCoordinatesTest::test_constructor()
+void NodeCoordinatesTest::test_nc_array()
{
int i,j;
@@ -34,6 +35,8 @@
-1.0, +1.0, +1.0
};
+ /* XXX: test nc_array */
+
double *m_coords = new double[nno * nsd];
for (i = 0; i < nno; i++)
{
@@ -45,13 +48,16 @@
}
const double delta = 1e-6;
- shared_ptr<NodeCoordinates> coords(new NodeCoordinates());
+ shared_ptr<nc_array> coords(new nc_array());
coords->setCoordinates(m_coords, nno, nsd);
for (i = 0; i < nno; i++)
{
for (j = 0; j < nsd; j++)
{
- CPPUNIT_ASSERT_DOUBLES_EQUAL(coords->getPoint(i,j), _coords[i*nsd+j], delta);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(
+ coords->getPoint(i,j),
+ _coords[i*nsd+j],
+ delta);
}
}
for (i =0; i < nno; i++)
Modified: cs/cigma/trunk/tests/libcigma/NodeCoordinatesTest.h
===================================================================
--- cs/cigma/trunk/tests/libcigma/NodeCoordinatesTest.h 2008-10-15 09:08:01 UTC (rev 13058)
+++ cs/cigma/trunk/tests/libcigma/NodeCoordinatesTest.h 2008-10-15 09:08:02 UTC (rev 13059)
@@ -9,13 +9,13 @@
class NodeCoordinatesTest : public CPPUNIT_NS::TestFixture
{
CPPUNIT_TEST_SUITE(NodeCoordinatesTest);
- CPPUNIT_TEST(test_constructor);
+ CPPUNIT_TEST(test_nc_array);
CPPUNIT_TEST_SUITE_END();
public:
NodeCoordinatesTest();
~NodeCoordinatesTest();
- void test_constructor();
+ void test_nc_array();
};
}
More information about the cig-commits
mailing list