S
Steven T. Hatton
I finally got this thing to build. There's something to be said for using
the release of the cvs image sometimes. :-/
I started reading the docs, and this example struck me as a fundamentally
bad design for C++. Perhaps it's not bad design in the sense that it will
fail, or that it can't be maintained. But there seems to be something
fundamentally un-C++ about this. Does anybody else see what I'm talking
about here?
class ComplexNumberTest : public CppUnit::TestFixture {
private:
Complex *m_10_1, *m_1_1, *m_11_2;
public:
void setUp()
{
m_10_1 = new Complex( 10, 1 );
m_1_1 = new Complex( 1, 1 );
m_11_2 = new Complex( 11, 2 );
}
void tearDown()
{
delete m_10_1;
delete m_1_1;
delete m_11_2;
}
void testEquality()
{
CPPUNIT_ASSERT( *m_10_1 == *m_10_1 );
CPPUNIT_ASSERT( !(*m_10_1 == *m_11_2) );
}
void testAddition()
{
CPPUNIT_ASSERT( *m_10_1 + *m_1_1 == *m_11_2 );
}
};
the release of the cvs image sometimes. :-/
I started reading the docs, and this example struck me as a fundamentally
bad design for C++. Perhaps it's not bad design in the sense that it will
fail, or that it can't be maintained. But there seems to be something
fundamentally un-C++ about this. Does anybody else see what I'm talking
about here?
class ComplexNumberTest : public CppUnit::TestFixture {
private:
Complex *m_10_1, *m_1_1, *m_11_2;
public:
void setUp()
{
m_10_1 = new Complex( 10, 1 );
m_1_1 = new Complex( 1, 1 );
m_11_2 = new Complex( 11, 2 );
}
void tearDown()
{
delete m_10_1;
delete m_1_1;
delete m_11_2;
}
void testEquality()
{
CPPUNIT_ASSERT( *m_10_1 == *m_10_1 );
CPPUNIT_ASSERT( !(*m_10_1 == *m_11_2) );
}
void testAddition()
{
CPPUNIT_ASSERT( *m_10_1 + *m_1_1 == *m_11_2 );
}
};