I would suggest taking a look at what code is actually generated, since you have a compilation problem, it sounds like the macro is not generating the code you are expecting it to. If you are using windows/VS you can use "cl.exe /E" or in g++/gcc you can use "gcc -E source.cpp" to run the preprocessor and generate the c++ file that will be compiled.
Unit tests can only be run once the code is successfully compiled (and can be tested like you would unit test any other code).
Your unit test code is expanding to this:
#include "UnitTest++.h"
#include "Classname.h"
namespace
{
TEST(SwitchpointTest1)
{
private:
comp::SwitchPoint* mSwitchpointObject;
public:
void setSwitchpointObject(bool val, unsigned short switchIdx = 0)
{
if(mSwitchpointObject) mSwitchpointObject->setValue(val,switchIdx);
}
bool getSwitchpointObject()
{
return (NULL == mSwitchpointObject ? false : mSwitchpointObject->getValue());
}
comp::SwitchPoint* getSwitchpointObject##Ptr()
{
return mSwitchpointObject;
}
mSwitchpointTestVariabele = CreateSwitchpoint("test switchpoint", 2);
CHECK_EQUAL(mSwitchpointTestVariabele->getValue(), true);
//mSwitchpointTestVariabele->setValue(false, 0);
//CHECK_EQUAL(mSwitchpointTestVariabele->getValue(), false);
//mSwitchpointTestVariabele->setValue(false, 1);
//CHECK_EQUAL(mSwitchpointTestVariabele->getValue(), false);
//mSwitchpointTestVariabele->setValue(true, 0);
//CHECK_EQUAL(mSwitchpointTestVariabele->getValue(), false);
//mSwitchpointTestVariabele->setValue(true, 1);
//CHECK_EQUAL(mSwitchpointTestVariabele->getValue(), true);
}
}