Lines Matching full:errorcode
13 #include "unicode/errorcode.h"
133 ErrorCode errorCode;
134 if(errorCode.get()!=U_ZERO_ERROR || !errorCode.isSuccess() || errorCode.isFailure()) {
135 errln("ErrorCode did not initialize properly");
138 errorCode.assertSuccess();
139 if(errorCode.errorName()!=u_errorName(U_ZERO_ERROR)) {
140 errln("ErrorCode did not format error message string properly");
142 RefPlusOne(errorCode);
143 if(errorCode.get()!=U_ILLEGAL_ARGUMENT_ERROR || errorCode.isSuccess() || !errorCode.isFailure()) {
144 errln("ErrorCode did not yield a writable reference");
146 PtrPlusTwo(errorCode);
147 if(errorCode.get()!=U_INVALID_FORMAT_ERROR || errorCode.isSuccess() || !errorCode.isFailure()) {
148 errln("ErrorCode did not yield a writable pointer");
150 errorCode.set(U_PARSE_ERROR);
151 if(errorCode.get()!=U_PARSE_ERROR || errorCode.isSuccess() || !errorCode.isFailure()) {
152 errln("ErrorCode.set() failed");
154 if( errorCode.reset()!=U_PARSE_ERROR || errorCode.get()!=U_ZERO_ERROR ||
155 !errorCode.isSuccess() || errorCode.isFailure()
157 errln("ErrorCode did not reset properly");
161 class MyErrorCode: public ErrorCode {
182 MyErrorCode errorCode(countChecks, countDests);
183 if( errorCode.get()!=U_ZERO_ERROR || !errorCode.isSuccess() || errorCode.isFailure() ||
186 errln("ErrorCode did not initialize properly");
189 errorCode.assertSuccess();
191 errln("ErrorCode.assertSuccess() called handleFailure() despite success");
193 RefPlusOne(errorCode);
194 if(errorCode.get()!=U_ILLEGAL_ARGUMENT_ERROR || errorCode.isSuccess() || !errorCode.isFailure()) {
195 errln("ErrorCode did not yield a writable reference");
197 errorCode.assertSuccess();
199 errln("ErrorCode.assertSuccess() did not handleFailure()");
201 PtrPlusTwo(errorCode);
202 if(errorCode.get()!=U_INVALID_FORMAT_ERROR || errorCode.isSuccess() || !errorCode.isFailure()) {
203 errln("ErrorCode did not yield a writable pointer");
205 errorCode.assertSuccess();
207 errln("ErrorCode.assertSuccess() did not handleFailure()");
209 errorCode.set(U_PARSE_ERROR);
210 if(errorCode.get()!=U_PARSE_ERROR || errorCode.isSuccess() || !errorCode.isFailure()) {
211 errln("ErrorCode.set() failed");
213 if( errorCode.reset()!=U_PARSE_ERROR || errorCode.get()!=U_ZERO_ERROR ||
214 !errorCode.isSuccess() || errorCode.isFailure()
216 errln("ErrorCode did not reset properly");
218 errorCode.assertSuccess();
220 errln("ErrorCode.assertSuccess() called handleFailure() despite success");
228 MyErrorCode errorCode(countChecks, countDests);
229 errorCode.set(U_PARSE_ERROR);
328 IcuTestErrorCode errorCode(*this, "TestLocalXyzPointer");
332 ucnvsel_open(&encoding, 1, NULL, UCNV_ROUNDTRIP_SET, errorCode));
333 if(errorCode.logIfFailureAndReset("ucnvsel_open()")) {
342 LocalUCalendarPointer cal(ucal_open(NULL, 0, "root", UCAL_GREGORIAN, errorCode));
343 if(errorCode.logDataIfFailureAndReset("ucal_open()")) {
351 LocalUDateTimePatternGeneratorPointer patgen(udatpg_open("root", errorCode));
352 if(errorCode.logDataIfFailureAndReset("udatpg_open()")) {
360 LocalULocaleDisplayNamesPointer ldn(uldn_open("de-CH", ULDN_STANDARD_NAMES, errorCode));
361 if(errorCode.logIfFailureAndReset("uldn_open()")) {
371 umsg_open(hello.getBuffer(), hello.length(), "root", NULL, errorCode));
372 if(errorCode.logIfFailureAndReset("umsg_open()")) {
382 const UNormalizer2 *nfc=unorm2_getNFCInstance(errorCode);
384 LocalUNormalizer2Pointer fn2(unorm2_openFiltered(nfc, emptySet.toUSet(), errorCode));
385 if(errorCode.logIfFailureAndReset("unorm2_openFiltered()")) {
395 LocalUIDNAPointer idna(uidna_openUTS46(0, errorCode));
396 if(errorCode.logIfFailureAndReset("uidna_openUTS46()")) {
408 uregex_open(pattern.getBuffer(), pattern.length(), 0, NULL, errorCode));
409 if(errorCode.logIfFailureAndReset("uregex_open()")) {
421 utrans_openU(id.getBuffer(), id.length(), UTRANS_FORWARD, NULL, 0, NULL, errorCode));
422 if(errorCode.logIfFailureAndReset("utrans_open()")) {
437 IcuTestErrorCode errorCode(*this, "TestLocalXyzPointerNull/LocalUConverterSelectorPointer");
441 ucnvsel_open(&encoding, 1, NULL, UCNV_ROUNDTRIP_SET, errorCode));
446 IcuTestErrorCode errorCode(*this, "TestLocalXyzPointerNull/LocalUCalendarPointer");
448 LocalUCalendarPointer cal(ucal_open(NULL, 0, "root", UCAL_GREGORIAN, errorCode));
449 if(!errorCode.logDataIfFailureAndReset("ucal_open()")) {
454 IcuTestErrorCode errorCode(*this, "TestLocalXyzPointerNull/LocalUDateTimePatternGeneratorPointer");
456 LocalUDateTimePatternGeneratorPointer patgen(udatpg_open("root", errorCode));
460 IcuTestErrorCode errorCode(*this, "TestLocalXyzPointerNull/LocalUMessageFormatPointer");
464 umsg_open(hello.getBuffer(), hello.length(), "root", NULL, errorCode));
471 IcuTestErrorCode errorCode(*this, "TestLocalXyzPointerNull/LocalURegularExpressionPointer");
475 uregex_open(pattern.getBuffer(), pattern.length(), 0, NULL, errorCode));
476 if(!errorCode
484 IcuTestErrorCode errorCode(*this, "TestLocalXyzPointerNull/LocalUTransliteratorPointer");
488 utrans_openU(id.getBuffer(), id.length(), UTRANS_FORWARD, NULL, 0, NULL, errorCode));
489 if(!errorCode.logDataIfFailureAndReset("utrans_openU()")) {