public virtual bool runTest()
{
int iNumStrings , iMaxLength ;
int iCountErrors = 0;
int iCountTestcases = 0;
string[] testStrs;
IList charData;
Console.Error.WriteLine( "IsSymbol_str_i runTest started." );
Random rand = new Random(unchecked((int)(DateTime.Now.Ticks)));
do
{
iNumStrings = rand.Next( 0, NUM_RANDOM_STRINGS);
iMaxLength = rand.Next( 0, MAX_RANDOM_STR_LENGTH);
} while ( iNumStrings < 1 && iMaxLength < 1 );
charData = m_CharData.GetValueList();
testStrs = new String[iNumStrings];
for (int iCurStr = 0; iCurStr < testStrs.Length; iCurStr++)
{
int iRdmStrLen = 0;
StringBuilder strbRdmString;
iRdmStrLen = rand.Next(1,iMaxLength + 1);
strbRdmString = new StringBuilder(iRdmStrLen);
for (int iCurChar = 0; iCurChar < iRdmStrLen; iCurChar++)
{
int iRdmCharIdx = -1;
CharInfo rdmCharInfo;
iRdmCharIdx = rand.Next(0,(int)m_CharData.Count);
rdmCharInfo = (CharInfo) charData[iRdmCharIdx];
strbRdmString.Append(rdmCharInfo.chChar);
}
testStrs[iCurStr] = strbRdmString.ToString();
}
foreach (string strCurTest in testStrs)
{
for (int iCurChar = 0; iCurChar < strCurTest.Length; iCurChar++)
{
CharInfo curCharInfo;
curCharInfo = (CharInfo) m_CharData[strCurTest[iCurChar]];
if ( (curCharInfo.eCategory == UnicodeCategory.MathSymbol) ||
(curCharInfo.eCategory == UnicodeCategory.CurrencySymbol) ||
(curCharInfo.eCategory == UnicodeCategory.ModifierSymbol) ||
(curCharInfo.eCategory == UnicodeCategory.OtherSymbol) )
{
iCountTestcases++ ;
if ( Char.IsSymbol(strCurTest,iCurChar) )
{
Console.WriteLine("Passed :: " +
"Categories match for char '" +
((int)(curCharInfo.chChar)).ToString("x4") +
"' at position " + iCurChar.ToString("d3") + " Category :: " +
curCharInfo.eCategory);
}
else
{
iCountErrors++ ;
Console.WriteLine("Failed :: " +
"Category mismatch for char '0x" +
((int)(curCharInfo.chChar)).ToString("x4") +
"' at position " + iCurChar.ToString("d3") +
" UCD Category : " + curCharInfo.eCategory +
" NLS+ Category : " +
Char.IsSymbol(strCurTest,iCurChar) );
}
}
}
}
if ( iCountErrors == 0 ){
Console.Error.Write( "Char_IsSymbol_str_i: paSs. iCountTestcases== " + iCountTestcases.ToString("d3"));
return true;
}
else{
Console.Error.Write( "Char_IsSymbol_str_i: Fail. iCountErrors== " + iCountErrors.ToString("d3"));
return false;
}
}
protected UnicodeCategory TranslateUnicodeCategory(string strCatAbbrev)