diff --git a/src/blockstore/blockstore_heap.cpp b/src/blockstore/blockstore_heap.cpp index 3f2042d1..66e3189e 100644 --- a/src/blockstore/blockstore_heap.cpp +++ b/src/blockstore/blockstore_heap.cpp @@ -136,7 +136,7 @@ uint32_t heap_object_t::calc_crc32c() { uint32_t old_crc32c = crc32c; crc32c = 0; - uint32_t res = ::crc32c(0, (uint8_t*)this, sizeof(this)); + uint32_t res = ::crc32c(0, (uint8_t*)this, sizeof(heap_object_t)); for (heap_write_t *wr = get_writes(); wr; wr = wr->next()) { res = ::crc32c(res, (uint8_t*)wr, wr->size); diff --git a/src/test/test_blockstore.cpp b/src/test/test_blockstore.cpp index 8a4ef460..457662cd 100644 --- a/src/test/test_blockstore.cpp +++ b/src/test/test_blockstore.cpp @@ -399,9 +399,9 @@ static void test_padded_csum_intent(bool perfect) heap_object_t *obj = test.bs->heap->read_entry((object_id){ .inode = 1, .stripe = 0 }, NULL); assert(obj); assert(!obj->get_writes()->next()->next()->next()); - assert(obj->get_writes()->flags == BS_HEAP_SMALL_WRITE); - assert(obj->get_writes()->next()->flags == (perfect ? BS_HEAP_SMALL_WRITE : BS_HEAP_INTENT_WRITE)); - assert(obj->get_writes()->next()->next()->flags == BS_HEAP_BIG_WRITE); + assert(obj->get_writes()->entry_type == BS_HEAP_SMALL_WRITE); + assert(obj->get_writes()->next()->entry_type == (perfect ? BS_HEAP_SMALL_WRITE : BS_HEAP_INTENT_WRITE)); + assert(obj->get_writes()->next()->next()->entry_type == BS_HEAP_BIG_WRITE); // Commit printf("commit version 3\n"); diff --git a/src/test/test_heap.cpp b/src/test/test_heap.cpp index ebbfadd9..71a5bf9f 100644 --- a/src/test/test_heap.cpp +++ b/src/test/test_heap.cpp @@ -640,7 +640,7 @@ void test_corruption() // reload heap with corruption { blockstore_heap_t heap(&dsk, buffer_area.data()); - heap.set_abort_on_corruption(true); + heap.set_abort_on_corruption(false); tmp.data()[10]++; // corrupt the first object heap.load_blocks(0, dsk.meta_block_size, tmp.data()); heap.finish_load();