예제 #1
0
        override public void Run()
        {
            BufferChunk bc = new BufferChunk(4);
            bc += (short)1;
            bc += (short)2;

            short ret = bc.NextInt16();

            if(bc.Length != 2)
            {
                throw new TestCaseException("unexpected index");
            }
        }
예제 #2
0
 override public void Run()
 {
     BufferChunk bc = new BufferChunk(2);
     bc += (short)1;
     
     if(bc.NextInt16() != (short)1)
     {
         throw new TestCaseException("bytes don't match");
     }
 }
예제 #3
0
        override public void Run()
        {
            BufferChunk bc = new BufferChunk(new byte[1]);

            try
            {
                bc.NextInt16();
                throw new TestCaseException("not enough data");
            }
            catch(BufferChunk.InsufficientDataException)
            {
                if(bc.Length != 1)
                {
                    throw new TestCaseException("lost data");
                }
            }
        }
예제 #4
0
 override public void Run()
 {
     BufferChunk bc = new BufferChunk(new byte[3]);
     bc.NextInt16();
 }
예제 #5
0
 override public void Run()
 {
     BufferChunk bc = new BufferChunk(2);
     
     try
     {
         bc.NextInt16();
         throw new TestCaseException("no data");
     }
     catch(BufferChunk.NoDataException){}
 }