From b9520a5be6816ed0627eda113efe64cedd4b461d Mon Sep 17 00:00:00 2001 From: Fabian Knorr Date: Tue, 17 Dec 2024 16:48:45 +0100 Subject: [PATCH] buffer::set_final_data accepts weak_ptr, not weak_ptr or shared_ptr --- tests/buffer/buffer_storage_common.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/tests/buffer/buffer_storage_common.h b/tests/buffer/buffer_storage_common.h index 7c9ae2e4f..f2f26b000 100644 --- a/tests/buffer/buffer_storage_common.h +++ b/tests/buffer/buffer_storage_common.h @@ -63,21 +63,19 @@ class buffer_storage_test { // Case 3 - Weak pointer std::shared_ptr data_shared_ptr(new T[size]); - std::weak_ptr data_final3 = data_shared_ptr; + std::shared_ptr data_shared_ptr_alias(data_shared_ptr, + data_shared_ptr.get()); + std::weak_ptr data_final3 = data_shared_ptr_alias; - // Case 4 - Shared pointer - std::shared_ptr data_final4(new T[size]); - - // Case 5 - Vector data + // Case 4 - Vector iterator std::vector data_vector; data_vector.resize(size); - auto data_final5 = data_vector.begin(); + auto data_final4 = data_vector.begin(); check_write_back(log, r, data_final1.get()); check_write_back(log, r, data_final2, true /*is_nullptr*/); check_write_back(log, r, data_final3); check_write_back(log, r, data_final4); - check_write_back(log, r, data_final5); } private: @@ -99,12 +97,11 @@ class buffer_storage_test { } } - template