コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustNotCheckForOutOfBoundsWhenReadingSingleRecord() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MustNotCheckForOutOfBoundsWhenReadingSingleRecord()
        {
            MyRecordFormat format = new MyRecordFormat(this);
            StubPageCursor cursor = new StubPageCursor(0, 3);

            format.Read(new MyRecord(this, 0), cursor, RecordLoad.NORMAL, 4);
            assertFalse(cursor.CheckAndClearBoundsFlag());
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustNotCheckForOutOfBoundsWhenWritingSingleRecord() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MustNotCheckForOutOfBoundsWhenWritingSingleRecord()
        {
            MyRecordFormat format = new MyRecordFormat(this);
            StubPageCursor cursor = new StubPageCursor(0, 3);
            MyRecord       record = new MyRecord(this, 0);

            record.InUse = true;
            format.Write(record, cursor, 4);
            assertFalse(cursor.CheckAndClearBoundsFlag());
        }
コード例 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustCheckForOutOfBoundsWhenReadingDoubleRecord() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MustCheckForOutOfBoundsWhenReadingDoubleRecord()
        {
            MyRecordFormat format = new MyRecordFormat(this);
            StubPageCursor cursor = new StubPageCursor(0, 4);

            cursor.PutByte(0, ( sbyte )(HEADER_BIT_RECORD_UNIT + HEADER_BIT_FIRST_RECORD_UNIT));
            StubPagedFile pagedFile = new StubPagedFileAnonymousInnerClass(this, cursor);

            format.ShortsPerRecordConflict.AddLast(2);
            format.Read(new MyRecord(this, 0), cursor, RecordLoad.NORMAL, 4);
            assertTrue(cursor.CheckAndClearBoundsFlag());
        }
コード例 #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustCheckForOutOfBoundsWhenWritingDoubleRecord() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MustCheckForOutOfBoundsWhenWritingDoubleRecord()
        {
            MyRecordFormat format = new MyRecordFormat(this);
            StubPageCursor cursor = new StubPageCursor(0, 5);
            MyRecord       record = new MyRecord(this, 0);

            record.RequiresSecondaryUnit = true;
            record.SecondaryUnitId       = 42;
            record.InUse = true;
            format.ShortsPerRecordConflict.AddLast(3);                 // make the write go out of bounds
            format.Write(record, cursor, 4);
            assertTrue(cursor.CheckAndClearBoundsFlag());
        }