开发者

Scope Problem with Visual Assert

开发者 https://www.devze.com 2023-04-07 01:21 出处:网络
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.

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

精彩评论

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