Example #1
0
 /* PageCorruption */
 public static PageCorruption <KEY, VALUE> Crashed <KEY, VALUE>(GBPTreePointerType gbpTreePointerType)
 {
     return((pageCursor, layout, node, treeState) =>
     {
         int offset = gbpTreePointerType.Offset(node);
         long stableGeneration = treeState.stableGeneration();
         long unstableGeneration = treeState.unstableGeneration();
         long crashGeneration = crashGeneration(treeState);
         pageCursor.Offset = offset;
         long pointer = pointer(GenerationSafePointerPair.Read(pageCursor, stableGeneration, unstableGeneration, NO_GENERATION_TARGET));
         OverwriteGSPP(pageCursor, offset, crashGeneration, pointer);
     });
 }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldRead()
        public virtual void ShouldRead()
        {
            // GIVEN
            _cursor.Offset = SLOT_A_OFFSET;
            long preStatePointerA = StateA.materialize(_cursor, POINTER_A);

            _cursor.Offset = _slotBOffset;
            long preStatePointerB = StateB.materialize(_cursor, POINTER_B);

            // WHEN
            _cursor.Offset = GSPP_OFFSET;
            GenerationKeeper generationKeeper = new GenerationKeeper();
            long             result           = GenerationSafePointerPair.Read(_cursor, STABLE_GENERATION, UNSTABLE_GENERATION, generationKeeper);

            // THEN
            ExpectedReadOutcome.verifyRead(_cursor, result, StateA, StateB, preStatePointerA, preStatePointerB, generationKeeper.Generation);
        }
Example #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));
        }