ReactOS  0.4.15-dev-509-g96a357b
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 //
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)));
26  }
27  catch (runtime_error const& /* e */) {
28  //CPPUNIT_MESSAGE( e.what() );
29  }
30  catch (...) {
32  }
33 # endif
34 
35  try {
36  locale loc(locale::classic(), new messages_byname<char>("yasli_language"));
38  }
39  catch (runtime_error const& /* e */) {
40  //CPPUNIT_MESSAGE( e.what() );
41  }
42  catch (...) {
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)));
64  }
65  catch (runtime_error const&) {
66  }
67  catch (...) {
69  }
70 # endif
71 
72  try {
73  locale loc(locale::classic(), new messages_byname<wchar_t>("yasli_language"));
75  }
76  catch (runtime_error const&) {
77  }
78  catch (...) {
80  }
81 # endif
82 # endif
83 }
84 
85 #endif
Definition: features.h:417
Definition: _locale.h:75
static const locale &_STLP_CALL classic()
Definition: locale.cpp:404
#define CPPUNIT_FAIL
Definition: cppunit_mini.h:206