From 895a56b247ba37c7715a5c26738950b5b948bbe4 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sat, 3 Jan 2004 16:29:55 +0000 Subject: [PATCH] Moved the shell variable into main(). Before the R5 UnitTester crashed with a segment violation when destroying globals. No idea why that happened, but now it works again. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5885 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tests/UnitTesterHelper.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/tests/UnitTesterHelper.cpp b/src/tests/UnitTesterHelper.cpp index ac834bfb27..ee4f2244a6 100644 --- a/src/tests/UnitTesterHelper.cpp +++ b/src/tests/UnitTesterHelper.cpp @@ -5,9 +5,9 @@ // ##### Include headers for statically linked tests here ##### //#include -UnitTesterShell shell("OpenBeOS Unit Testing Framework", new SemaphoreSyncObject); int main(int argc, char *argv[]) { + UnitTesterShell shell("OpenBeOS Unit Testing Framework", new SemaphoreSyncObject); // ##### Add test suites for statically linked tests here ##### // shell.AddTest( "Example", ExampleTest::Suite() ); @@ -15,7 +15,12 @@ int main(int argc, char *argv[]) { // Load our dynamically linked tests - return shell.Run(argc, argv); + int result = shell.Run(argc, argv); + + // Unset global shell, just to be sure + BTestShell::SetGlobalShell(NULL); + + return result; } //const std::string UnitTesterShell::defaultLibDir = "./lib";