From 64ec9666a66b8e13c3093a6d374a95acf631f2d3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 16 Jul 2008 02:30:40 +0000 Subject: [PATCH] disable the test if we have no strtoll() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@54656 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- tests/strings/strings.cpp | 52 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/tests/strings/strings.cpp b/tests/strings/strings.cpp index de831886c5..1607ef0a22 100644 --- a/tests/strings/strings.cpp +++ b/tests/strings/strings.cpp @@ -519,7 +519,7 @@ void StringTestCase::ToULong() } } -#ifdef wxLongLong_t +#ifdef wxHAS_STRTOLL void StringTestCase::ToLongLong() { @@ -531,9 +531,31 @@ void StringTestCase::ToLongLong() if ( ld.flags & (Number_Long | Number_Unsigned) ) continue; - CPPUNIT_ASSERT_EQUAL( ld.IsOk(), wxString(ld.str).ToLongLong(&l) ); if ( ld.IsOk() ) + { + CPPUNIT_ASSERT_MESSAGE + ( + std::string(wxString::Format + ( + _T("Conversion of \"%s\" to long long failed"), + ld.str + ).mb_str()), + wxString(ld.str).ToLongLong(&l) + ); CPPUNIT_ASSERT_EQUAL( ld.LLValue(), l ); + } + else + { + CPPUNIT_ASSERT_MESSAGE + ( + std::string(wxString::Format + ( + _T("Conversion of \"%s\" to long long succeeded"), + ld.str + ).mb_str()), + !wxString(ld.str).ToLongLong(&l) + ); + } } } @@ -547,13 +569,35 @@ void StringTestCase::ToULongLong() if ( ld.flags & (Number_Long | Number_Signed) ) continue; - CPPUNIT_ASSERT_EQUAL( ld.IsOk(), wxString(ld.str).ToULongLong(&ul) ); if ( ld.IsOk() ) + { + CPPUNIT_ASSERT_MESSAGE + ( + std::string(wxString::Format + ( + _T("Conversion of \"%s\" to unsigned long long failed"), + ld.str + ).mb_str()), + wxString(ld.str).ToULongLong(&ul) + ); CPPUNIT_ASSERT_EQUAL( ld.ULLValue(), ul ); + } + else + { + CPPUNIT_ASSERT_MESSAGE + ( + std::string(wxString::Format + ( + _T("Conversion of \"%s\" to unsigned long long succeeded"), + ld.str + ).mb_str()), + !wxString(ld.str).ToULongLong(&ul) + ); + } } } -#endif // wxLongLong_t +#endif // wxHAS_STRTOLL void StringTestCase::ToDouble() {