public Boolean runTest()
{
Console.Error.WriteLine( s_strTFPath + " " + s_strTFName + " , for " + s_strComponentBeingTested + " ,Source ver " + s_strDtTmVer );
int iCountTestcases = 0;
int iCountErrors = 0;
if ( verbose ) Console.WriteLine( "construct stream that is not exposed, should get an exception" );
try
{
++iCountTestcases;
MemoryStream ms = new MemoryStream( new byte[] { Byte.MinValue, Byte.MaxValue }, 1, 1, false, false );
try
{
ms.GetBuffer();
++iCountErrors;
Console.WriteLine( "Err_001b, should have thrown AccessException" );
}
catch ( UnauthorizedAccessException )
{
}
catch(Exception ex)
{
Console.WriteLine("Err_7452fdsf! Wrong exception thrown. " + ex);
}
}
catch (Exception ex)
{
++iCountErrors;
Console.WriteLine( "Err_001a, Unexpected exception was thrown ex: " + ex.ToString() );
}
if ( verbose ) Console.WriteLine( "construct stream that we can write to" );
try
{
++iCountTestcases;
MemoryStream ms = new MemoryStream( new byte[] { Byte.MinValue, Byte.MaxValue }, 1, 1, true, true );
ms.GetBuffer();
}
catch (Exception ex)
{
++iCountErrors;
Console.WriteLine( "Err_002a, Unexpected exception was thrown ex: " + ex.ToString() );
}
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 )