Use "C" locale for locale-dependent part of TextCtrlTestCase.
As we expect to get decimal points in the text control when we stream floating point numbers into it, we must do it in a locale which uses decimal point, e.g. "C" one. Otherwise the test failed when ran in e.g. French locale. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65390 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -24,6 +24,8 @@
|
|||||||
#include "wx/textctrl.h"
|
#include "wx/textctrl.h"
|
||||||
#endif // WX_PRECOMP
|
#endif // WX_PRECOMP
|
||||||
|
|
||||||
|
#include "wx/scopeguard.h"
|
||||||
|
|
||||||
#include "textentrytest.h"
|
#include "textentrytest.h"
|
||||||
#include "testableframe.h"
|
#include "testableframe.h"
|
||||||
#include "asserthelper.h"
|
#include "asserthelper.h"
|
||||||
@@ -206,13 +208,19 @@ void TextCtrlTestCase::MaxLength()
|
|||||||
void TextCtrlTestCase::StreamInput()
|
void TextCtrlTestCase::StreamInput()
|
||||||
{
|
{
|
||||||
#ifndef __WXOSX__
|
#ifndef __WXOSX__
|
||||||
*m_text << "stringinput"
|
{
|
||||||
<< 10
|
// Ensure we use decimal point and not a comma.
|
||||||
<< 1000L
|
char * const locOld = setlocale(LC_NUMERIC, "C");
|
||||||
<< 3.14f
|
wxON_BLOCK_EXIT2( setlocale, (int)LC_NUMERIC, locOld );
|
||||||
<< 2.71
|
|
||||||
<< 'a'
|
*m_text << "stringinput"
|
||||||
<< L'b';
|
<< 10
|
||||||
|
<< 1000L
|
||||||
|
<< 3.14f
|
||||||
|
<< 2.71
|
||||||
|
<< 'a'
|
||||||
|
<< L'b';
|
||||||
|
}
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL("stringinput1010003.142.71ab", m_text->GetValue());
|
CPPUNIT_ASSERT_EQUAL("stringinput1010003.142.71ab", m_text->GetValue());
|
||||||
|
|
||||||
@@ -234,8 +242,8 @@ void TextCtrlTestCase::StreamInput()
|
|||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL("stringinput1010003.142.71a", m_text->GetValue());
|
CPPUNIT_ASSERT_EQUAL("stringinput1010003.142.71a", m_text->GetValue());
|
||||||
|
|
||||||
#endif
|
#endif // wxHAS_TEXT_WINDOW_STREAM
|
||||||
#endif
|
#endif // !__WXOSX__
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextCtrlTestCase::Redirector()
|
void TextCtrlTestCase::Redirector()
|
||||||
|
Reference in New Issue
Block a user