Skip to content

Commit 03a8981

Browse files
committed
Rename test_potentially_slicing_shared_ptr.cpp,py → test_potentially_slicing_weak_ptr.cpp,py
1 parent 7c4a8bc commit 03a8981

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ set(PYBIND11_TEST_FILES
161161
test_opaque_types
162162
test_operator_overloading
163163
test_pickling
164-
test_potentially_slicing_shared_ptr
164+
test_potentially_slicing_weak_ptr
165165
test_python_multiple_inheritance
166166
test_pytypes
167167
test_sequences_and_iterators

tests/test_potentially_slicing_shared_ptr.cpp renamed to tests/test_potentially_slicing_weak_ptr.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <memory>
88

99
namespace pybind11_tests {
10-
namespace potentially_slicing_shared_ptr {
10+
namespace potentially_slicing_weak_ptr {
1111

1212
template <int> // Using int as a trick to easily generate multiple types.
1313
struct VirtBase {
@@ -138,12 +138,12 @@ void wrap(py::module_ &m,
138138
.def("get_trampoline_state", &WpOwner<VB>::get_trampoline_state);
139139
}
140140

141-
} // namespace potentially_slicing_shared_ptr
141+
} // namespace potentially_slicing_weak_ptr
142142
} // namespace pybind11_tests
143143

144-
using namespace pybind11_tests::potentially_slicing_shared_ptr;
144+
using namespace pybind11_tests::potentially_slicing_weak_ptr;
145145

146-
TEST_SUBMODULE(potentially_slicing_shared_ptr, m) {
146+
TEST_SUBMODULE(potentially_slicing_weak_ptr, m) {
147147
py::classh<VirtBaseSH, PyVirtBaseSH>(m, "VirtBaseSH")
148148
.def(py::init<>())
149149
.def("get_code", &VirtBaseSH::get_code);

tests/test_potentially_slicing_shared_ptr.py renamed to tests/test_potentially_slicing_weak_ptr.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# - Holder type: std::shared_ptr (class_ holder) vs.
1111
# py::smart_holder
1212
# - Conversion function: obj.cast<std::shared_ptr<T>>() vs.
13-
# py::potentially_slicing_shared_ptr<T>(obj)
13+
# py::potentially_slicing_weak_ptr<T>(obj)
1414
# - Python object type: C++ base class vs.
1515
# Python-derived trampoline class
1616
#
@@ -37,7 +37,7 @@
3737
import pytest
3838

3939
import env
40-
import pybind11_tests.potentially_slicing_shared_ptr as m
40+
import pybind11_tests.potentially_slicing_weak_ptr as m
4141

4242

4343
class PyDrvdSH(m.VirtBaseSH):
@@ -159,16 +159,16 @@ def test_with_wp_owner(holder_kind, set_meth, expected_code):
159159
assert wpo.get_code() == -999
160160

161161

162-
def test_potentially_slicing_shared_ptr_not_convertible_error():
162+
def test_potentially_slicing_weak_ptr_not_convertible_error():
163163
with pytest.raises(Exception) as excinfo:
164164
m.SH_rtrn_potentially_slicing_shared_ptr("")
165165
assert str(excinfo.value) == (
166166
'"str" object is not convertible to std::weak_ptr<T>'
167-
" (with T = pybind11_tests::potentially_slicing_shared_ptr::VirtBase<0>)"
167+
" (with T = pybind11_tests::potentially_slicing_weak_ptr::VirtBase<0>)"
168168
)
169169
with pytest.raises(Exception) as excinfo:
170170
m.SP_rtrn_potentially_slicing_shared_ptr([])
171171
assert str(excinfo.value) == (
172172
'"list" object is not convertible to std::weak_ptr<T>'
173-
" (with T = pybind11_tests::potentially_slicing_shared_ptr::VirtBase<1>)"
173+
" (with T = pybind11_tests::potentially_slicing_weak_ptr::VirtBase<1>)"
174174
)

0 commit comments

Comments
 (0)