コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void checkChildShouldThrowOnWriteFailure()
        internal virtual void CheckChildShouldThrowOnWriteFailure()
        {
            // GIVEN
            write(_cursor, 123, 0, _firstGeneration);
            _cursor.rewind();
            write(_cursor, 456, _firstGeneration, _secondGeneration);
            _cursor.rewind();

            // WHEN
            // This write will see first and second written pointers and think they belong to CRASHed generation
            long result = write(_cursor, 789, 0, _thirdGeneration);

            assertThrows(typeof(TreeInconsistencyException), () => PointerChecking.checkPointer(result, false));
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void checkSiblingShouldThrowOnReadIllegalPointer()
        internal virtual void CheckSiblingShouldThrowOnReadIllegalPointer()
        {
            // GIVEN
            long generation = IdSpace.STATE_PAGE_A;
            long pointer    = this._secondGeneration;

            // Can not use GenerationSafePointer.write because it will fail on pointer assertion.
            _cursor.putInt(( int )pointer);
            put6BLong(_cursor, generation);
            _cursor.putShort(GenerationSafePointer.ChecksumOf(generation, pointer));
            _cursor.rewind();

            // WHEN
            long result = read(_cursor, _firstGeneration, pointer, NO_GENERATION_TARGET);

            assertThrows(typeof(TreeInconsistencyException), () => PointerChecking.checkPointer(result, true));
        }
コード例 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void checkChildShouldThrowOnReadFailure()
        internal virtual void CheckChildShouldThrowOnReadFailure()
        {
            long result = GenerationSafePointerPair.Read(_cursor, 0, 1, NO_GENERATION_TARGET);

            assertThrows(typeof(TreeInconsistencyException), () => PointerChecking.checkPointer(result, false));
        }
コード例 #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void checkChildShouldThrowOnNoNode()
        internal virtual void CheckChildShouldThrowOnNoNode()
        {
            assertThrows(typeof(TreeInconsistencyException), () => PointerChecking.checkPointer(TreeNode.NO_NODE_FLAG, false));
        }
コード例 #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void checkSiblingShouldThrowOnReadFailure()
        internal virtual void CheckSiblingShouldThrowOnReadFailure()
        {
            long result = read(_cursor, _firstGeneration, _secondGeneration, NO_GENERATION_TARGET);

            assertThrows(typeof(TreeInconsistencyException), () => PointerChecking.checkPointer(result, true));
        }