开发者

Scope Problem with Visual Assert

I'm trying to use Visual Assert for testing. Visual Studio says the method I want to test which is defined inside main.cpp is undefined in the Test Fixture.

MyFunctionTest.cpp:

#include <cfixcc.h>

class ExampleTest : public cfixcc::TestFixture
{
private:

public:
    void Test()
    {
        CFIXCC_ASSERT_EQUALS(4, MyFuncti开发者_如何学JAVAon(2,2));
    }
};

CFIXCC_BEGIN_CLASS(ExampleTest)
    CFIXCC_METHOD(Test)
CFIXCC_END_CLASS()

I didn't make a separate project for tests so the two files are a part of the same project. How can I have MyFunction visible for Visual Assert to work properly?


#include the header that declares MyFunction()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜