Exemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void checkChildShouldPassOnWriteSuccess()
        internal virtual void CheckChildShouldPassOnWriteSuccess()
        {
            // WHEN
            long result = write(_cursor, 123, 0, _firstGeneration);

            // THEN
            PointerChecking.CheckPointer(result, false);
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void checkSiblingShouldPassOnReadSuccessForNoNodePointer()
        internal virtual void CheckSiblingShouldPassOnReadSuccessForNoNodePointer()
        {
            // GIVEN
            write(_cursor, TreeNode.NO_NODE_FLAG, _firstGeneration, _secondGeneration);
            _cursor.rewind();

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

            // THEN
            PointerChecking.CheckPointer(result, true);
        }
Exemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void checkChildShouldPassOnReadSuccess()
        internal virtual void CheckChildShouldPassOnReadSuccess()
        {
            // GIVEN
            PointerChecking.CheckPointer(write(_cursor, 123, 0, _firstGeneration), false);
            _cursor.rewind();

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

            // THEN
            PointerChecking.CheckPointer(result, false);
        }
Exemplo n.º 4
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));
        }
Exemplo n.º 5
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));
        }
Exemplo n.º 6
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));
        }
Exemplo n.º 7
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));
        }
Exemplo n.º 8
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));
        }