public bool runTest()
{
Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver : " + s_strDtTmVer);
int iCountErrors = 0;
int iCountTestcases = 0;
String strLoc = "Loc_000oo";
SerializationInfo serinfo1 = null;
Type tpName = null;
Int32 iNumberOfMembers;
String[] arrNames = null;
Object[] arrValues = null;
SerializationInfoEnumerator serenum1 = null;
int iNum = 0;
SerializationEntry serEnt1;
try {
do
{
serinfo1 = new SerializationInfo(typeof(Int32), new FormatterConverter());
iNumberOfMembers = 50;
arrNames = new String[iNumberOfMembers];
arrValues = new Object[iNumberOfMembers];
for(int i=0; i<iNumberOfMembers;i++)
{
arrNames[i] = i.ToString();
arrValues[i] = i;
serinfo1.AddValue(arrNames[i], arrValues[i], typeof(Int32));
}
serenum1 = serinfo1.GetEnumerator();
iNum = 0;
while(serenum1.MoveNext())
{
iCountTestcases++;
serEnt1 = serenum1.Current;
if(!serEnt1.ObjectType.Equals(typeof(Int32)))
{
iCountErrors++;
Console.WriteLine("Err_4753fg_" + iNum.ToString() + "! Wrong value, " + serEnt1.ObjectType);
}
if(!serEnt1.Name.Equals(iNum.ToString()))
{
iCountErrors++;
Console.WriteLine("Err_7439gdg_" + iNum.ToString() + "! Wrong value, " + serEnt1.Name);
}
if((Int32)serEnt1.Value != iNum)
{
iCountErrors++;
Console.WriteLine("Err_7439gdg_" + iNum.ToString() + "! Wrong value, " + serEnt1.Value);
}
iNum++;
}
tpName = Type.GetType("System.Int16");
serinfo1 = new SerializationInfo(tpName, new FormatterConverter());
serenum1 = serinfo1.GetEnumerator();
iCountTestcases++;
if(serenum1.MoveNext())
{
iCountErrors++;
Console.WriteLine("Err_03576bfd! most peculiar, MoveNext returned true!");
}
try
{
iCountTestcases++;
serEnt1 = serenum1.Current;
iCountErrors++;
Console.WriteLine("Err_0346gsdf! Exception not thrown");
}
catch(InvalidOperationException){}
catch(Exception ex)
{
iCountErrors++;
Console.WriteLine("Err_752gs! Wrong Exception thrown," + ex.ToString());
}
} while (false);
} catch (Exception exc_general ) {
++iCountErrors;
Console.WriteLine (s_strTFAbbrev + " : Error Err_8888yyy! strLoc=="+ strLoc +", exc_general==\n"+exc_general.StackTrace);
}
if ( iCountErrors == 0 )
{
Console.WriteLine( "paSs. "+s_strTFPath +" "+s_strTFName+" ,iCountTestcases=="+iCountTestcases.ToString());
return true;
}
else
{
Console.WriteLine("FAiL! "+s_strTFPath+" "+s_strTFName+" ,iCountErrors=="+iCountErrors.ToString()+" , BugNums?: "+s_strActiveBugNums );
return false;
}
}
public static void Main(String[] args)