mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
TestSuite: Don't leak the suite instance
Makes checking for leaks more straightforward
This commit is contained in:
parent
fc479d1e20
commit
a9db382f0e
Notes:
sideshowbarker
2024-07-19 13:06:33 +09:00
Author: https://github.com/rburchell Commit: https://github.com/SerenityOS/serenity/commit/a9db382f0eb Pull-request: https://github.com/SerenityOS/serenity/pull/354
1 changed files with 8 additions and 0 deletions
|
@ -79,6 +79,13 @@ public:
|
|||
s_global = new TestSuite();
|
||||
return *s_global;
|
||||
}
|
||||
|
||||
static void release()
|
||||
{
|
||||
delete s_global;
|
||||
s_global = nullptr;
|
||||
}
|
||||
|
||||
void run(const NonnullRefPtrVector<TestCase>& tests);
|
||||
void main(const String& suite_name, int argc, char** argv);
|
||||
NonnullRefPtrVector<TestCase> find_cases(const String& search, bool find_tests, bool find_benchmarks);
|
||||
|
@ -225,6 +232,7 @@ using AK::TestSuite;
|
|||
{ \
|
||||
static_assert(compiletime_lenof(___str(SuiteName)) != 0, "Set SuiteName"); \
|
||||
TestSuite::the().main(___str(SuiteName), argc, argv); \
|
||||
TestSuite::release(); \
|
||||
}
|
||||
|
||||
#define assertEqual(one, two) \
|
||||
|
|
Loading…
Reference in a new issue