Lines Matching refs:ErrorCode
13 #include "unicode/errorcode.h"
88 ErrorCode errorCode;
89 if(errorCode.get()!=U_ZERO_ERROR || !errorCode.isSuccess() || errorCode.isFailure()) {
90 errln("ErrorCode did not initialize properly");
93 errorCode.assertSuccess();
94 if(errorCode.errorName()!=u_errorName(U_ZERO_ERROR)) {
95 errln("ErrorCode did not format error message string properly");
97 RefPlusOne(errorCode);
98 if(errorCode.get()!=U_ILLEGAL_ARGUMENT_ERROR || errorCode.isSuccess() || !errorCode.isFailure()) {
99 errln("ErrorCode did not yield a writable reference");
101 PtrPlusTwo(errorCode);
102 if(errorCode.get()!=U_INVALID_FORMAT_ERROR || errorCode.isSuccess() || !errorCode.isFailure()) {
103 errln("ErrorCode did not yield a writable pointer");
105 errorCode.set(U_PARSE_ERROR);
106 if(errorCode.get()!=U_PARSE_ERROR || errorCode.isSuccess() || !errorCode.isFailure()) {
107 errln("ErrorCode.set() failed");
109 if( errorCode.reset()!=U_PARSE_ERROR || errorCode.get()!=U_ZERO_ERROR ||
110 !errorCode.isSuccess() || errorCode.isFailure()
112 errln("ErrorCode did not reset properly");
116 class MyErrorCode: public ErrorCode {
137 MyErrorCode errorCode(countChecks, countDests);
138 if( errorCode.get()!=U_ZERO_ERROR || !errorCode.isSuccess() || errorCode.isFailure() ||
141 errln("ErrorCode did not initialize properly");
144 errorCode.assertSuccess();
146 errln("ErrorCode.assertSuccess() called handleFailure() despite success");
148 RefPlusOne(errorCode);
149 if(errorCode.get()!=U_ILLEGAL_ARGUMENT_ERROR || errorCode.isSuccess() || !errorCode.isFailure()) {
150 errln("ErrorCode did not yield a writable reference");
152 errorCode.assertSuccess();
154 errln("ErrorCode.assertSuccess() did not handleFailure()");
156 PtrPlusTwo(errorCode);
157 if(errorCode.get()!=U_INVALID_FORMAT_ERROR || errorCode.isSuccess() || !errorCode.isFailure()) {
158 errln("ErrorCode did not yield a writable pointer");
160 errorCode.assertSuccess();
162 errln("ErrorCode.assertSuccess() did not handleFailure()");
164 errorCode.set(U_PARSE_ERROR);
165 if(errorCode.get()!=U_PARSE_ERROR || errorCode.isSuccess() || !errorCode.isFailure()) {
166 errln("ErrorCode.set() failed");
168 if( errorCode.reset()!=U_PARSE_ERROR || errorCode.get()!=U_ZERO_ERROR ||
169 !errorCode.isSuccess() || errorCode.isFailure()
171 errln("ErrorCode did not reset properly");
173 errorCode.assertSuccess();
175 errln("ErrorCode.assertSuccess() called handleFailure() despite success");
183 MyErrorCode errorCode(countChecks, countDests);
184 errorCode.set(U_PARSE_ERROR);
282 IcuTestErrorCode errorCode(*this, "TestLocalXyzPointer");
286 ucnvsel_open(&encoding, 1, NULL, UCNV_ROUNDTRIP_SET, errorCode));
287 if(errorCode.logIfFailureAndReset("ucnvsel_open()")) {
296 LocalUCalendarPointer cal(ucal_open(NULL, 0, "root", UCAL_GREGORIAN, errorCode));
297 if(errorCode.logDataIfFailureAndReset("ucal_open()")) {
305 LocalUDateTimePatternGeneratorPointer patgen(udatpg_open("root", errorCode));
306 if(errorCode.logIfFailureAndReset("udatpg_open()")) {
314 LocalULocaleDisplayNamesPointer ldn(uldn_open("de-CH", ULDN_STANDARD_NAMES, errorCode));
315 if(errorCode.logIfFailureAndReset("uldn_open()")) {
325 umsg_open(hello.getBuffer(), hello.length(), "root", NULL, errorCode));
326 if(errorCode.logIfFailureAndReset("umsg_open()")) {
336 const UNormalizer2 *nfc=unorm2_getInstance(NULL, "nfc", UNORM2_COMPOSE, errorCode);
338 LocalUNormalizer2Pointer fn2(unorm2_openFiltered(nfc, emptySet.toUSet(), errorCode));
339 if(errorCode.logIfFailureAndReset("unorm2_openFiltered()")) {
351 uregex_open(pattern.getBuffer(), pattern.length(), 0, NULL, errorCode));
352 if(errorCode.logIfFailureAndReset("uregex_open()")) {
364 utrans_openU(id.getBuffer(), id.length(), UTRANS_FORWARD, NULL, 0, NULL, errorCode));
365 if(errorCode.logIfFailureAndReset("utrans_open()")) {
380 IcuTestErrorCode errorCode(*this, "TestLocalXyzPointerNull/LocalUConverterSelectorPointer");
384 ucnvsel_open(&encoding, 1, NULL, UCNV_ROUNDTRIP_SET, errorCode));
389 IcuTestErrorCode errorCode(*this, "TestLocalXyzPointerNull/LocalUCalendarPointer");
391 LocalUCalendarPointer cal(ucal_open(NULL, 0, "root", UCAL_GREGORIAN, errorCode));
392 if(!errorCode.logDataIfFailureAndReset("ucal_open()")) {
397 IcuTestErrorCode errorCode(*this, "TestLocalXyzPointerNull/LocalUDateTimePatternGeneratorPointer");
399 LocalUDateTimePatternGeneratorPointer patgen(udatpg_open("root", errorCode));
403 IcuTestErrorCode errorCode(*this, "TestLocalXyzPointerNull/LocalUMessageFormatPointer");
407 umsg_open(hello.getBuffer(), hello.length(), "root", NULL, errorCode));
414 IcuTestErrorCode errorCode(*this, "TestLocalXyzPointerNull/LocalURegularExpressionPointer");
418 uregex_open(pattern.getBuffer(), pattern.length(), 0, NULL, errorCode));
419 if(!errorCode.logDataIfFailureAndReset("urege_open()")) {
427 IcuTestErrorCode errorCode(*this, "TestLocalXyzPointerNull/LocalUTransliteratorPointer");
431 utrans_openU(id.getBuffer(), id.length(), UTRANS_FORWARD, NULL, 0, NULL, errorCode));
432 if(!errorCode.logDataIfFailureAndReset("utrans_openU()")) {