+ CPPUNIT_ASSERT_EQUAL( ld.ok, wxString(ld.str).ToCDouble(&d) );
+ if ( ld.ok )
+ CPPUNIT_ASSERT_EQUAL( ld.value, d );
+ }
+
+
+ // test ToDouble() now:
+ // NOTE: for the test to be reliable, we need to set the locale explicitly
+ // so that we know the decimal point character to use
+
+ if (!wxLocale::IsAvailable(wxLANGUAGE_FRENCH))
+ return; // you should have french support installed to continue this test!
+
+ wxLocale locale;
+
+ // don't load default catalog, it may be unavailable:
+ CPPUNIT_ASSERT( locale.Init(wxLANGUAGE_FRENCH, wxLOCALE_DONT_LOAD_DEFAULT) );
+
+ static const struct ToDoubleData doubleData2[] =
+ {
+ { wxT("1"), 1, true },
+ { wxT("1,23"), 1.23, true },
+ { wxT(",1"), .1, true },
+ { wxT("1,"), 1, true },
+ { wxT("1,,"), 0, false },
+ { wxT("0"), 0, true },
+ { wxT("a"), 0, false },
+ { wxT("12345"), 12345, true },
+ { wxT("-1"), -1, true },
+ { wxT("--1"), 0, false },
+ { wxT("-3E-5"), -3E-5, true },
+ { wxT("-3E-abcde5"), 0, false },
+ };
+
+ for ( n = 0; n < WXSIZEOF(doubleData2); n++ )
+ {
+ const ToDoubleData& ld = doubleData2[n];