public void LeakDetectorDisposesLeaks() { var mainAllocator = new LeakDetectorWrapperAllocator(new HGlobalAllocator()); var allocator = new LeakDetectorWrapperAllocator(mainAllocator); allocator.Allocate((IntPtr)4); allocator.Dispose(); Assert.Equal(0u, mainAllocator.QueryAllocations().Count); }
public void LeakDetectorWorks() { var allocator = new LeakDetectorWrapperAllocator(new HGlobalAllocator()); var ptr1 = allocator.Allocate((IntPtr)4); var ptr2 = allocator.Allocate((IntPtr)8); var ptr3 = allocator.Allocate((IntPtr)16); allocator.Deallocate(ptr2); var leaks = allocator.QueryAllocations(); Assert.Equal(2u, leaks.Count); Assert.Equal(20ul, leaks.Size); allocator.Deallocate(ptr1); allocator.Deallocate(ptr3); Assert.Throws <InvalidOperationException>(() => allocator.Deallocate(ptr1)); }
public CursorTestsBase() { _allocator = new LeakDetectorWrapperAllocator(new HGlobalAllocator()); _root = ARTImpl.CreateEmptyRoot(_allocator, Is12); _cursor = _root.CreateCursor(); }
public RootNodeTests() { _allocator = new LeakDetectorWrapperAllocator(new HGlobalAllocator()); _impl = new ARTImpl(_allocator, false); }
public ArtInMemoryArtInMemoryKeyValueDBTest() { _allocator = new LeakDetectorWrapperAllocator(new HGlobalAllocator()); }
public RootNode12Tests() { _allocator = new LeakDetectorWrapperAllocator(new HGlobalAllocator()); _impl = new ARTImpl12(_allocator); }
protected CursorTestsBase() { _allocator = new LeakDetectorWrapperAllocator(new HGlobalAllocator()); _root = BTreeImpl12.CreateEmptyRoot(_allocator); _cursor = _root !.CreateCursor(); }
public BTreeKeyValueDBTest() { _allocator = new LeakDetectorWrapperAllocator(new MallocAllocator()); }
public BTreeKeyValueDBTest(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { _allocator = new LeakDetectorWrapperAllocator(new HGlobalAllocator()); }
public CursorTestsBase() { _allocator = new LeakDetectorWrapperAllocator(new HGlobalAllocator()); _root = Is12 ? BTreeImpl12.CreateEmptyRoot(_allocator) : null /*ARTImplV.CreateEmptyRoot(_allocator)*/; _cursor = _root.CreateCursor(); }