compilation fix for unicode
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26070 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
// headers
|
// headers
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#include "wx/wx.h"
|
||||||
#include "wx/strconv.h"
|
#include "wx/strconv.h"
|
||||||
#include "wx/string.h"
|
#include "wx/string.h"
|
||||||
|
|
||||||
@@ -32,9 +33,13 @@ private:
|
|||||||
|
|
||||||
void WC2CP1250();
|
void WC2CP1250();
|
||||||
|
|
||||||
NO_COPY_CLASS(MBConvTestCase);
|
DECLARE_NO_COPY_CLASS(MBConvTestCase);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// register in the unnamed registry so that these tests are run by default
|
||||||
|
CPPUNIT_TEST_SUITE_REGISTRATION( MBConvTestCase );
|
||||||
|
|
||||||
|
// also include in it's own registry so that these tests can be run alone
|
||||||
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( MBConvTestCase, "MBConvTestCase" );
|
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( MBConvTestCase, "MBConvTestCase" );
|
||||||
|
|
||||||
void MBConvTestCase::WC2CP1250()
|
void MBConvTestCase::WC2CP1250()
|
||||||
@@ -46,26 +51,20 @@ void MBConvTestCase::WC2CP1250()
|
|||||||
} data[] =
|
} data[] =
|
||||||
{
|
{
|
||||||
{ L"hello", "hello" }, // test that it works in simplest case
|
{ L"hello", "hello" }, // test that it works in simplest case
|
||||||
{ L"<EFBFBD> of <20> is <20>", "" }, // this should fail as cp1250 doesn't have 1/2
|
{ L"<EFBFBD> of <20> is <20>", NULL }, // this should fail as cp1250 doesn't have 1/2
|
||||||
};
|
};
|
||||||
|
|
||||||
wxCSConv cs1250(wxFONTENCODING_CP1250);
|
wxCSConv cs1250(wxFONTENCODING_CP1250);
|
||||||
for ( size_t n = 0; n < WXSIZEOF(data); n++ )
|
for ( size_t n = 0; n < WXSIZEOF(data); n++ )
|
||||||
{
|
{
|
||||||
const Data& d = data[n];
|
const Data& d = data[n];
|
||||||
CPPUNIT_ASSERT( wxString(d.wc, cs1250) == d.cp1250 );
|
if (d.cp1250)
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
// program entry point
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
{
|
||||||
CppUnit::TextUi::TestRunner runner;
|
CPPUNIT_ASSERT( strcmp(cs1250.cWC2MB(d.wc), d.cp1250) == 0 );
|
||||||
runner.addTest(MBConvTestCase::suite());
|
}
|
||||||
|
else
|
||||||
return runner.run("") ? 0 : 1;
|
{
|
||||||
|
CPPUNIT_ASSERT( cs1250.cWC2MB(d.wc) == NULL );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user