Add test funtion for shared_ptr usage