Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (32 sloc) 766 Bytes
#pragma once
// available only if Google C++ Test Framework is available
#if GTEST
#include "gtest/gtest.h"
namespace yasi{
// shorthand for adding a testcase in a test fixture
#define ADD_TEST_F(testcase, test) TEST_F(testcase, test){ test(); }
class Test : public ::testing::Test{
protected:
#ifdef _WIN32
_CrtMemState t1, t2, t3;
#endif
virtual void setUp(){
#ifdef _WIN32
_CrtMemCheckpoint(&t1);
#endif
}
virtual void tearDown(){
#ifdef _WIN32
_CrtMemCheckpoint(&t2);
if (_CrtMemDifference(&t3, &t1, &t2)) {
// _CrtMemDumpStatistics(&t3);
// _CrtDumpMemoryLeaks();
_CrtMemDumpAllObjectsSince(&t1);
}
#endif
}
public:
virtual ~Test(){}
};
} // namespace yasi
#endif // GTEST
You can’t perform that action at this time.