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";
String strValue = String.Empty;
try
{
FileStream fs2;
String filName = s_strTFAbbrev + "TestFile.tmp";
if(File.Exists(filName))
File.Delete(filName);
strLoc = "Loc_9g8yg";
fs2 = new FileStream(filName, FileMode.Create);
fs2.Write(new Byte[]{65,66,67,68,69,70}, 0, 6);
fs2.Flush();
StreamReader sr2 = new StreamReader(fs2);
iCountTestcases++;
fs2.Position = 0;
if(!sr2.ReadToEnd().Equals("ABCDEF"))
{
iCountErrors++;
printerr( "Error_19009! Not flushed correctly");
}
fs2.Position = 3;
fs2.Write(new Byte[]{65,66,67}, 0, 3);
fs2.Flush();
fs2.Position = 0;
if(!sr2.ReadToEnd().Equals("ABCABC"))
{
iCountErrors++;
printerr( "Error_01909! Not flushed correctly");
}
sr2.Close();
strLoc = "Loc_857yv";
fs2 = new FileStream(filName, FileMode.Create);
fs2.Write(new Byte[]{1}, 0, 1);
fs2.Close();
iCountTestcases++;
try
{
fs2.Flush();
iCountErrors++;
printerr( "Error_50039! Expected exception not thrown");
}
catch (ObjectDisposedException iexc)
{
printinfo( "Info_0199x! Caught expected exception, exc=="+iexc.Message);
}
catch (Exception exc)
{
iCountErrors++;
printerr( "Error_298t8! Incorrect exception thrown, exc=="+exc.ToString());
}
if(File.Exists(filName))
File.Delete(filName);
}
catch (Exception exc_general )
{
++iCountErrors;
Console.WriteLine (s_strTFAbbrev + " : Error Err_8888yyy! strLoc=="+ strLoc +", exc_general=="+exc_general.ToString());
}
if ( iCountErrors == 0 )
{
Console.WriteLine( "paSs. "+s_strTFName+" ,iCountTestcases=="+iCountTestcases.ToString());
return true;
}
else
{
Console.WriteLine("FAiL! "+s_strTFName+" ,iCountErrors=="+iCountErrors.ToString()+" , BugNums?: "+s_strActiveBugNums );
return false;
}
}
public void printerr ( String err )