]> git.saurik.com Git - wxWidgets.git/blame - tests/mbconv/main.cpp
Charsets part moved from console sample to test unit.
[wxWidgets.git] / tests / mbconv / main.cpp
CommitLineData
2cc07181
VZ
1///////////////////////////////////////////////////////////////////////////////
2// Name: tests/mbconv/main.cpp
3// Purpose: wxMBConv unit test
4// Author: Vadim Zeitlin
5// Created: 14.02.04
6// RCS-ID: $Id$
7// Copyright: (c) 2003 TT-Solutions
8///////////////////////////////////////////////////////////////////////////////
9
10// ----------------------------------------------------------------------------
11// headers
12// ----------------------------------------------------------------------------
13
20f46e8d
VS
14#include "wx/wxprec.h"
15
16#ifdef __BORLANDC__
17 #pragma hdrstop
18#endif
19
20#ifndef WX_PRECOMP
21 #include "wx/wx.h"
22#endif // WX_PRECOMP
23
2cc07181
VZ
24#include "wx/strconv.h"
25#include "wx/string.h"
26
bc55323b
WS
27#if wxUSE_FONTMAP
28 #include "wx/fontmap.h"
29#endif // wxUSE_FONTMAP
30
2cc07181
VZ
31#include "wx/cppunit.h"
32
33// ----------------------------------------------------------------------------
34// test class
35// ----------------------------------------------------------------------------
36
37class MBConvTestCase : public CppUnit::TestCase
38{
39public:
40 MBConvTestCase() { }
41
42private:
43 CPPUNIT_TEST_SUITE( MBConvTestCase );
44 CPPUNIT_TEST( WC2CP1250 );
bc55323b 45 CPPUNIT_TEST( Charsets );
2cc07181
VZ
46 CPPUNIT_TEST_SUITE_END();
47
48 void WC2CP1250();
bc55323b 49 void Charsets();
2cc07181 50
20f46e8d 51 DECLARE_NO_COPY_CLASS(MBConvTestCase)
2cc07181
VZ
52};
53
98eae466
VS
54// register in the unnamed registry so that these tests are run by default
55CPPUNIT_TEST_SUITE_REGISTRATION( MBConvTestCase );
56
57// also include in it's own registry so that these tests can be run alone
2cc07181
VZ
58CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( MBConvTestCase, "MBConvTestCase" );
59
60void MBConvTestCase::WC2CP1250()
61{
62 static const struct Data
63 {
64 const wchar_t *wc;
65 const char *cp1250;
66 } data[] =
67 {
68 { L"hello", "hello" }, // test that it works in simplest case
98eae466 69