Menu

C++ forbids declaration of ‘TestFixtureType'

Help
Rob bert
2008-07-30
2013-04-22
  • Rob bert

    Rob bert - 2008-07-30

    I am getting an infuriating compiler error that I cannot for the life of me figure out. The primary problem seems to be the first error of: ISO C++ forbids declaration of TestFixtureType.

    plugins/testsarb_binary/boundstest.h:17: error: ISO C++ forbids declaration of ‘TestFixtureType’ with no type
    plugins/testsarb_binary/boundstest.h: In static member function ‘static const CppUnit::TestNamer&<anonymous class>::getTestNamer__()’:
    plugins/testsarb_binary/boundstest.h:17: error: expected primary-expression before ‘)’ token
    plugins/testsarb_binary/boundstest.h: In static member function ‘static void<anonymous class>::addTestsToSuite(CppUnit::TestSuiteBuilderContex
    tBase&)’:
    plugins/testsarb_binary/boundstest.h:18: error: ‘TestFixtureType’ is not a class or namespace

    I have done some research and this usually means that you aren't including the right paths or namespaces. However, I include the cppunit/include directory, and it doesn't seem like I have a namespace issue. Obviously the macros get expanded, but I don't know how I would fix the problem in the macro.

    my compile is:
    "g++"  -ftemplate-depth-128 -O0 -fno-inline -Wall -g -fPIC -m32 -Wno-unused-variable -Wno-reorder   -I"/home/**/**/include" -I"/home/**/**/plugins/testHelper" -I"/home/**/**/vendor/cppunit/include"  -c -o "/home/**/**/bin/plugins/testsarb_binary/gcc/debug/boundstest.o" "plugins/testsarb_binary/boundstest.cpp"

    my code is as follows:

    #ifndef arb_binary_bounds_test
    #define arb_binary_bounds_test

    #include "../arb_binary_bounds.h"
    #include "testHelper.h"
    #include <cppunit/extensions/HelperMacros.h>
    #include <cppunit/TestFixture.h>

    class arb_binary_bounds_test : public CppUnit::TestFixture {
        CPPUNIT_TEST_SUITE(arb_binary_bounds_test);
        CPPUNIT_TEST (valuesNotPresent);
        CPPUNIT_TEST_SUITE_END ();
    public:

        void setUp();
        void tearDown();

        //tests to make sure that incomplete values does
        //not break test
       //the tests should contain values that don't correspond
        //to this test
        void valuesNotPresent();

    private:
        testHelper help;
        ctc::pluginFramework::arb_binary_bounds b;
    };
    #endif

     
    • Rob bert

      Rob bert - 2008-07-30

      I will also include the cpp file:

      CPPUNIT_TEST_SUITE_REGISTRATION(arb_binary_bounds_test);

          arb_binary_bounds_test::arb_binary_bounds_test(std::string name){

          }

          void arb_binary_bounds_test::setUp(){
          }

          void arb_binary_bounds_test::tearDown(){
          }

          /**
          * valusesnotpresent tests to make sure incomplete input objects
          * do not cause the test to fail
          * \param testfile is a string containing xml to test the testfile should not create any errors.
          */
          void arb_binary_bounds_test::valuesnotpresent(){
              CPPUNIT_ASSERT(5>4);
          }

       

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.