2007-01-04 04:22:23 +01:00
|
|
|
// Got to be consistent with what the rest of the source files do before
|
|
|
|
// including precompiled.h, so that the PCH works correctly
|
|
|
|
#ifndef CXXTEST_RUNNING
|
|
|
|
#define CXXTEST_RUNNING
|
|
|
|
#endif
|
|
|
|
#define _CXXTEST_HAVE_STD
|
|
|
|
|
2006-12-20 04:09:21 +01:00
|
|
|
#include "precompiled.h"
|
|
|
|
|
|
|
|
#include <cxxtest/GlobalFixture.h>
|
|
|
|
|
2008-01-20 17:53:09 +01:00
|
|
|
#if OS_WIN
|
2008-06-30 19:34:18 +02:00
|
|
|
#include "lib/sysdep/os/win/wdbg_heap.h"
|
2008-01-20 17:53:09 +01:00
|
|
|
#endif
|
|
|
|
|
2006-12-20 04:09:21 +01:00
|
|
|
class LeakReporter : public CxxTest::GlobalFixture
|
|
|
|
{
|
|
|
|
virtual bool tearDownWorld()
|
|
|
|
{
|
|
|
|
// Enable leak reporting on exit.
|
|
|
|
// (This is done in tearDownWorld so that it doesn't report 'leaks'
|
|
|
|
// if the program is aborted before finishing cleanly.)
|
2008-01-20 17:53:09 +01:00
|
|
|
#if OS_WIN
|
|
|
|
wdbg_heap_Enable(true);
|
2006-12-20 04:09:21 +01:00
|
|
|
#endif
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual bool setUpWorld()
|
|
|
|
{
|
2008-01-08 01:09:52 +01:00
|
|
|
#if MSC_VERSION
|
2006-12-20 04:09:21 +01:00
|
|
|
// (Warning: the allocation numbers seem to differ by 3 when you
|
|
|
|
// run in the build process vs the debugger)
|
|
|
|
// _CrtSetBreakAlloc(1952);
|
|
|
|
#endif
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
static LeakReporter leakReporter;
|
2007-03-19 21:58:46 +01:00
|
|
|
|
|
|
|
// Definition of function from lib/self_test.h
|
|
|
|
bool ts_str_contains(const std::string& str1, const std::string& str2)
|
|
|
|
{
|
|
|
|
return str1.find(str2) != str1.npos;
|
|
|
|
}
|