Menu

Cant get it to work at all.

2000-11-09
2000-11-09
  • Erik Ramfelt

    Erik Ramfelt - 2000-11-09

    I cant get CppUnit 1.5.3 to work with my clean TestCase. When I compile I
    get the following errors below.
    My test class (DiscoCamTestCase) derives from TestCase and implements
    countTestCases, which returns 1 and another test method.

    The compile error is provoked by the following method
    CppUnit::TestSuite*
    DiscoCamTestCase::suite()
    {
    TestSuite *suiteOfTests = new TestSuite;
            suiteOfTests->addTest(new TestCaller<DiscoCamTestCase>("testAdd", testReset));
            return suiteOfTests;
    }

    Ive almost copied everything from the code documentation for TestCase, but I have no clue on what is wrong or how I can fix it.

    Any help is appreciated.

    Im posting here, since I cant find any good documentation on how
    to create a very simple testcase.
    ------COMPILE ERROR ------------
    DiscoCamTestCase.cpp: In function `static class CppUnit::TestSuite * DiscoCamTestCase::suite()':
    DiscoCamTestCase.cpp:27: cannot allocate an object of type `CppUnit::TestSuite'
    DiscoCamTestCase.cpp:27:   since the following virtual functions are abstract:
    /usr/local/include/cppunit/Test.h:21:   int CppUnit::Test::countTestCases() const
    DiscoCamTestCase.cpp:28: cannot allocate an object of type `CppUnit::TestCaller<DiscoCamTestCase>'
    DiscoCamTestCase.cpp:28:   since the following virtual functions are abstract:
    /usr/local/include/cppunit/Test.h:21:   int CppUnit::Test::countTestCases() const
    -----------------------------------------

     
    • Robert Withrow

      Robert Withrow - 2000-11-09

      This is due to the lack of "const" in certain places.  Look
      in patches, where I have posted a fix.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.