#include "wx/textctrl.h"
#endif // WX_PRECOMP
+#include "wx/scopeguard.h"
+
#include "textentrytest.h"
#include "testableframe.h"
#include "asserthelper.h"
// register in the unnamed registry so that these tests are run by default
CPPUNIT_TEST_SUITE_REGISTRATION( TextCtrlTestCase );
-// also include in it's own registry so that these tests can be run alone
+// also include in its own registry so that these tests can be run alone
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( TextCtrlTestCase, "TextCtrlTestCase" );
// ----------------------------------------------------------------------------
void TextCtrlTestCase::StreamInput()
{
#ifndef __WXOSX__
- *m_text << "stringinput"
- << 10
- << 1000L
- << 3.14f
- << 2.71
- << 'a'
- << L'b';
+ {
+ // Ensure we use decimal point and not a comma.
+ char * const locOld = setlocale(LC_NUMERIC, "C");
+ wxON_BLOCK_EXIT2( setlocale, (int)LC_NUMERIC, locOld );
+
+ *m_text << "stringinput"
+ << 10
+ << 1000L
+ << 3.14f
+ << 2.71
+ << 'a'
+ << L'b';
+ }
CPPUNIT_ASSERT_EQUAL("stringinput1010003.142.71ab", m_text->GetValue());
CPPUNIT_ASSERT_EQUAL("stringinput1010003.142.71a", m_text->GetValue());
-#endif
-#endif
+#endif // wxHAS_TEXT_WINDOW_STREAM
+#endif // !__WXOSX__
}
void TextCtrlTestCase::Redirector()