Test wxPropertyGrid::DoubleToString()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66457 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -878,6 +878,27 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
|
|||||||
RT_FAILURE();
|
RT_FAILURE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
RT_START_TEST(DoubleToString)
|
||||||
|
|
||||||
|
// Locale-specific decimal separator
|
||||||
|
wxString sep = wxString::Format("%g", 1.1)[1];
|
||||||
|
|
||||||
|
wxString s;
|
||||||
|
|
||||||
|
if ( wxPropertyGrid::DoubleToString(s, 123.123, 2, true) !=
|
||||||
|
wxString::Format("123%s12", sep.c_str()) )
|
||||||
|
RT_FAILURE();
|
||||||
|
if ( wxPropertyGrid::DoubleToString(s, -123.123, 4, false) !=
|
||||||
|
wxString::Format("-123%s1230", sep.c_str()) )
|
||||||
|
RT_FAILURE();
|
||||||
|
if ( wxPropertyGrid::DoubleToString(s, -0.02, 1, false) !=
|
||||||
|
wxString::Format("0%s0", sep) )
|
||||||
|
RT_FAILURE();
|
||||||
|
if ( wxPropertyGrid::DoubleToString(s, -0.000123, 3, true) != "0" )
|
||||||
|
RT_FAILURE();
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
wxPropertyGridPage* page1;
|
wxPropertyGridPage* page1;
|
||||||
wxPropertyGridPage* page2;
|
wxPropertyGridPage* page2;
|
||||||
|
Reference in New Issue
Block a user