I have a Windows graphics application built with MFC and wanted to write unit tests using the Catch2 framework but when it executes it runs the dialog and it does not run the test. See a bit of my code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
class CGridCtrlTest : public CGridCtrl
{
public:
int* p = nullptr;
int* get() const { return p; }
};
TEST_CASE_METHOD(CGridCtrlTest, "Test method")
{
p = newint{ 44 };
auto x = get();
REQUIRE(p != nullptr);
}
TEST_CASE("test function")
{
REQUIRE(1 == 1);
}