From 56f1948cc56313ad291e42b7ba4b9134b1347552 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 | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/buffer/buffer_storage_common.h b/tests/buffer/buffer_storage_common.h index 7c9ae2e4f..4cf403495 100644 --- a/tests/buffer/buffer_storage_common.h +++ b/tests/buffer/buffer_storage_common.h @@ -63,21 +63,18 @@ 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 +96,11 @@ class buffer_storage_test { } } - template