Attempt to work around Mac g++ 4.0 bug in fswatcher unit test.

Don't define the class overriding a virtual base class method inside the test
function as g++ 4.0 under OS X 10.5 fails to compile this for some mysterious
reason.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67722 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-05-10 08:54:20 +00:00
parent a082862987
commit d3eec3b672

View File

@@ -614,13 +614,23 @@ void FileSystemWatcherTestCase::TestEventAccess()
tester.Run();
}
void FileSystemWatcherTestCase::TestNoEventsAfterRemove()
namespace
{
class EventTester : public EventHandler,
// We can't define this class locally inside TestNoEventsAfterRemove() for some
// reason with g++ 4.0 under OS X 10.5, it results in the following mysterious
// error:
//
// /var/tmp//ccTkNCkc.s:unknown:Non-global symbol:
// __ZThn80_ZN25FileSystemWatcherTestCase23TestNoEventsAfterRemoveEvEN11EventTester6NotifyEv.eh
// can't be a weak_definition
//
// So define this class outside the function instead.
class NoEventsAfterRemoveEventTester : public EventHandler,
public wxTimer
{
public:
EventTester()
{
public:
NoEventsAfterRemoveEventTester()
{
// We need to use an inactivity timer as we never get any file
// system events in this test, so we consider that the test is
@@ -651,8 +661,12 @@ void FileSystemWatcherTestCase::TestNoEventsAfterRemove()
{
SendIdle();
}
};
};
EventTester tester;
} // anonymous namespace
void FileSystemWatcherTestCase::TestNoEventsAfterRemove()
{
NoEventsAfterRemoveEventTester tester;
tester.Run();
}