From d326d52cd98a6b394f9303371712b89d21f7d356 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 19 Jan 2011 15:08:11 +0000 Subject: [PATCH] Use setUp/tearDown() for NumFormatter test case locale setup. 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 --- tests/strings/numformatter.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/strings/numformatter.cpp b/tests/strings/numformatter.cpp index 7ab235bc81..989cd4e1cc 100644 --- a/tests/strings/numformatter.cpp +++ b/tests/strings/numformatter.cpp @@ -27,22 +27,22 @@ 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: