Setting the locale in the ctor of the test object doesn't work because the
locale is changed by the other tests that run before this one, use the
initialization method provided by cppunit to change the locale instead, this
is somewhat wasteful but at least it does work, unlike the old version.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66718
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
class NumFormatterTestCase : public CppUnit::TestCase
{
public:
- NumFormatterTestCase()
+ NumFormatterTestCase() { m_locale = NULL; }
+
+ virtual void setUp()
{
// We need to use a locale with known decimal point and which uses the
// thousands separator for the tests to make sense.
m_locale = new wxLocale(wxLANGUAGE_ENGLISH_UK,
wxLOCALE_DONT_LOAD_DEFAULT);
if ( !m_locale->IsOk() )
- {
- delete m_locale;
- m_locale = NULL;
- }
+ tearDown();
}
- virtual ~NumFormatterTestCase()
+ virtual void tearDown()
{
delete m_locale;
+ m_locale = NULL;
}
private: