ReactOS
0.4.16-dev-340-g0540c21
messages_facets_test.cpp
Go to the documentation of this file.
1
#include "
locale_test.h
"
2
3
#if !defined (STLPORT) || !defined (_STLP_USE_NO_IOSTREAMS)
4
# include <locale>
5
# include <stdexcept>
6
7
# if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
8
using namespace
std
;
9
# endif
10
11
//
12
// tests implementation
13
//
14
void
LocaleTest::messages_by_name
()
15
{
16
/*
17
* Check of the 22.1.1.2.7 standard point. Construction of a locale
18
* instance from a null pointer or an unknown name should result in
19
* a runtime_error exception.
20
*/
21
# if !defined (STLPORT) || defined (_STLP_USE_EXCEPTIONS)
22
# if defined (STLPORT) || !defined (__GNUC__)
23
try
{
24
locale
loc(
locale::classic
(),
new
messages_byname<char>
(
static_cast<
char
const
*
>
(0)));
25
CPPUNIT_FAIL
;
26
}
27
catch
(
runtime_error
const
&
/* e */
) {
28
//CPPUNIT_MESSAGE( e.what() );
29
}
30
catch
(...) {
31
CPPUNIT_FAIL
;
32
}
33
# endif
34
35
try
{
36
locale
loc(
locale::classic
(),
new
messages_byname<char>
(
"yasli_language"
));
37
CPPUNIT_FAIL
;
38
}
39
catch
(
runtime_error
const
&
/* e */
) {
40
//CPPUNIT_MESSAGE( e.what() );
41
}
42
catch
(...) {
43
CPPUNIT_FAIL
;
44
}
45
46
/*
47
try {
48
locale loc(locale::classic(), new messages_byname<char>(""));
49
CPPUNIT_FAIL;
50
}
51
catch (runtime_error const& e) {
52
CPPUNIT_MESSAGE( e.what() );
53
}
54
catch (...) {
55
CPPUNIT_FAIL;
56
}
57
*/
58
59
# if !defined (STLPORT) || !defined (_STLP_NO_WCHAR_T)
60
# if defined (STLPORT) || !defined (__GNUC__)
61
try
{
62
locale
loc(
locale::classic
(),
new
messages_byname<wchar_t>
(
static_cast<
char
const
*
>
(0)));
63
CPPUNIT_FAIL
;
64
}
65
catch
(
runtime_error
const
&) {
66
}
67
catch
(...) {
68
CPPUNIT_FAIL
;
69
}
70
# endif
71
72
try
{
73
locale
loc(
locale::classic
(),
new
messages_byname<wchar_t>
(
"yasli_language"
));
74
CPPUNIT_FAIL
;
75
}
76
catch
(
runtime_error
const
&) {
77
}
78
catch
(...) {
79
CPPUNIT_FAIL
;
80
}
81
# endif
82
# endif
83
}
84
85
#endif
LocaleTest::messages_by_name
void messages_by_name()
Definition:
messages_facets_test.cpp:14
locale
Definition:
_locale.h:75
locale::classic
static const locale &_STLP_CALL classic()
Definition:
locale.cpp:404
messages_byname
Definition:
_messages_facets.h:120
runtime_error
Definition:
_stdexcept.h:41
CPPUNIT_FAIL
#define CPPUNIT_FAIL
Definition:
cppunit_mini.h:206
locale_test.h
std
Definition:
features.h:417
const
#define const
Definition:
zconf.h:233
sdk
lib
3rdparty
stlport
test
unit
messages_facets_test.cpp
Generated on Thu Dec 12 2024 06:13:06 for ReactOS by
1.9.6