コード例 #1
0
ファイル: ReadByte.cs プロジェクト: maikahj/corefx
    public static void Main(string[] args)
    {
        ReadByte objTest = new ReadByte();

        AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(objTest.AppDomainUnhandledException_EventHandler);

        Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver : " + s_strDtTmVer);

        try
        {
            objTest.RunTest();
        }
        catch (Exception e)
        {
            Console.WriteLine(s_strTFAbbrev + " : FAIL The following exception was thorwn in RunTest(): \n" + e.ToString());
            objTest._numErrors++;
            objTest._exitValue = TCSupport.FailExitCode;
        }

        ////	Finish Diagnostics
        if (objTest._numErrors == 0)
        {
            Console.WriteLine("PASS.	 "+ s_strTFPath + " " + s_strTFName + " ,numTestcases==" + objTest._numTestcases);
        }
        else
        {
            Console.WriteLine("FAIL!	 "+ s_strTFPath + " " + s_strTFName + " ,numErrors==" + objTest._numErrors);

            if (TCSupport.PassExitCode == objTest._exitValue)
            {
                objTest._exitValue = TCSupport.FailExitCode;
            }
        }

        Environment.ExitCode = objTest._exitValue;
    }
コード例 #2
0
 public void Dispose()
 {
     _encoding = null;
     _file = null;
     _buffer = null;
     _readFunction = null;
 }
コード例 #3
0
 public void Bind(FileStream file, int BufferStartOffset)
 {
     if (file == null) throw new ArgumentNullException("file");
     _file = file;
     _readFunction = ReadFromFile;
     _file.Seek(_bufferStartOffset, SeekOrigin.Begin);
     ReadHeader(BufferStartOffset);
 }
コード例 #4
0
 public void Bind(byte[] buffer, int BufferStartOffset)
 {
     if (buffer == null) throw new ArgumentNullException("buffer");
     _buffer = buffer;
     _readFunction = ReadFromBuffer;
     ReadHeader(BufferStartOffset);
 }
コード例 #5
0
 public BasicTypeDeSerializerContext(FileStream file)
 {
     if (file == null) throw new ArgumentNullException("file");
     _file = file;
     _readFunction = ReadFromFile;
     ReadHeader();
 }
コード例 #6
0
 public BasicTypeDeSerializerContext(byte[] buffer)
 {
     if (buffer == null) throw new ArgumentNullException("buffer");
     _buffer = buffer;
     _readFunction = ReadFromBuffer;
     ReadHeader();
 }