+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
*
*
*******************************************************************************
* file name: idnaref.cpp
- * encoding: US-ASCII
+ * encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
return b2Len;
}
+
+static NamePrepTransform* getInstance(UErrorCode& status){
+ TestIDNA *thisTest = dynamic_cast<TestIDNA *>(IntlTest::gTest);
+ if (thisTest == nullptr && U_SUCCESS(status)) {
+ status = U_INTERNAL_PROGRAM_ERROR;
+ }
+ if (U_FAILURE(status)) return nullptr;
+ return thisTest->getInstance(status);
+}
+
+
static int32_t convertFromPuny( const UChar* src, int32_t srcLength,
UChar* dest, int32_t destCapacity,
UErrorCode& status){
b1[b1Len++] = src[j];
}
- NamePrepTransform* prep = TestIDNA::getInstance(*status);
+ NamePrepTransform* prep = getInstance(*status);
if(U_FAILURE(*status)){
goto CLEANUP;
}
reqLength=0;
// UParseError parseError;
- NamePrepTransform* prep = TestIDNA::getInstance(*status);
+ NamePrepTransform* prep = getInstance(*status);
b1Len = 0;
UBool* caseFlags = NULL;
int32_t reqLength = 0;
// UParseError parseError;
- NamePrepTransform* prep = TestIDNA::getInstance(*status);
+ NamePrepTransform* prep = getInstance(*status);
//initialize pointers to stack buffers
UChar b1Stack[MAX_LABEL_BUFFER_SIZE];
}
labelStart = delimiter;
- remainingLen = srcLength - (delimiter - src);
+ remainingLen = static_cast<int32_t>(srcLength - (delimiter - src));
}
}
UBool done = FALSE;
- NamePrepTransform* prep = TestIDNA::getInstance(*status);
+ NamePrepTransform* prep = getInstance(*status);
//initialize pointers to stack buffers
UChar b1Stack[MAX_LABEL_BUFFER_SIZE];
}
labelStart = delimiter;
- remainingLen = srcLength - (delimiter - src);
+ remainingLen = static_cast<int32_t>(srcLength - (delimiter - src));
}
}