]>
Commit | Line | Data |
---|---|---|
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 | ||
98eae466 | 14 | #include "wx/wx.h" |
2cc07181 VZ |
15 | #include "wx/strconv.h" |
16 | #include "wx/string.h" | |
17 | ||
18 | #include "wx/cppunit.h" | |
19 | ||
20 | // ---------------------------------------------------------------------------- | |
21 | // test class | |
22 | // ---------------------------------------------------------------------------- | |
23 | ||
24 | class MBConvTestCase : public CppUnit::TestCase | |
25 | { | |
26 | public: | |
27 | MBConvTestCase() { } | |
28 | ||
29 | private: | |
30 | CPPUNIT_TEST_SUITE( MBConvTestCase ); | |
31 | CPPUNIT_TEST( WC2CP1250 ); | |
32 | CPPUNIT_TEST_SUITE_END(); | |
33 | ||
34 | void WC2CP1250(); | |
35 | ||
98eae466 | 36 | DECLARE_NO_COPY_CLASS(MBConvTestCase); |
2cc07181 VZ |
37 | }; |
38 | ||
98eae466 VS |
39 | // register in the unnamed registry so that these tests are run by default |
40 | CPPUNIT_TEST_SUITE_REGISTRATION( MBConvTestCase ); | |
41 | ||
42 | // also include in it's own registry so that these tests can be run alone | |
2cc07181 VZ |
43 | CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( MBConvTestCase, "MBConvTestCase" ); |
44 | ||
45 | void MBConvTestCase::WC2CP1250() | |
46 | { | |
47 | static const struct Data | |
48 | { | |
49 | const wchar_t *wc; | |
50 | const char *cp1250; | |
51 | } data[] = | |
52 | { | |
53 | { L"hello", "hello" }, // test that it works in simplest case | |
98eae466 | 54 |