Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenmessages_facets_test.cpp
Go to the documentation of this file.
00001 #include "locale_test.h" 00002 00003 #if !defined (STLPORT) || !defined (_STLP_USE_NO_IOSTREAMS) 00004 # include <locale> 00005 # include <stdexcept> 00006 00007 # if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES) 00008 using namespace std; 00009 # endif 00010 00011 // 00012 // tests implementation 00013 // 00014 void LocaleTest::messages_by_name() 00015 { 00016 /* 00017 * Check of the 22.1.1.2.7 standard point. Construction of a locale 00018 * instance from a null pointer or an unknown name should result in 00019 * a runtime_error exception. 00020 */ 00021 # if !defined (STLPORT) || defined (_STLP_USE_EXCEPTIONS) 00022 # if defined (STLPORT) || !defined (__GNUC__) 00023 try { 00024 locale loc(locale::classic(), new messages_byname<char>(static_cast<char const*>(0))); 00025 CPPUNIT_FAIL; 00026 } 00027 catch (runtime_error const& /* e */) { 00028 //CPPUNIT_MESSAGE( e.what() ); 00029 } 00030 catch (...) { 00031 CPPUNIT_FAIL; 00032 } 00033 # endif 00034 00035 try { 00036 locale loc(locale::classic(), new messages_byname<char>("yasli_language")); 00037 CPPUNIT_FAIL; 00038 } 00039 catch (runtime_error const& /* e */) { 00040 //CPPUNIT_MESSAGE( e.what() ); 00041 } 00042 catch (...) { 00043 CPPUNIT_FAIL; 00044 } 00045 00046 /* 00047 try { 00048 locale loc(locale::classic(), new messages_byname<char>("")); 00049 CPPUNIT_FAIL; 00050 } 00051 catch (runtime_error const& e) { 00052 CPPUNIT_MESSAGE( e.what() ); 00053 } 00054 catch (...) { 00055 CPPUNIT_FAIL; 00056 } 00057 */ 00058 00059 # if !defined (STLPORT) || !defined (_STLP_NO_WCHAR_T) 00060 # if defined (STLPORT) || !defined (__GNUC__) 00061 try { 00062 locale loc(locale::classic(), new messages_byname<wchar_t>(static_cast<char const*>(0))); 00063 CPPUNIT_FAIL; 00064 } 00065 catch (runtime_error const&) { 00066 } 00067 catch (...) { 00068 CPPUNIT_FAIL; 00069 } 00070 # endif 00071 00072 try { 00073 locale loc(locale::classic(), new messages_byname<wchar_t>("yasli_language")); 00074 CPPUNIT_FAIL; 00075 } 00076 catch (runtime_error const&) { 00077 } 00078 catch (...) { 00079 CPPUNIT_FAIL; 00080 } 00081 # endif 00082 # endif 00083 } 00084 00085 #endif Generated on Sat May 26 2012 04:34:20 for ReactOS by
1.7.6.1
|