MCPcopy Create free account
hub / github.com/pybind/pybind11 / TEST_SUBMODULE

Function TEST_SUBMODULE

tests/test_potentially_slicing_weak_ptr.cpp:150–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148using namespace pybind11_tests::potentially_slicing_weak_ptr;
149
150TEST_SUBMODULE(potentially_slicing_weak_ptr, m) {
151 py::classh<VirtBaseSH, PyVirtBaseSH>(m, "VirtBaseSH")
152 .def(py::init<>())
153 .def("get_code", &VirtBaseSH::get_code);
154
155 py::class_<VirtBaseSP, std::shared_ptr<VirtBaseSP>, PyVirtBaseSP>(m, "VirtBaseSP")
156 .def(py::init<>())
157 .def("get_code", &VirtBaseSP::get_code);
158
159 wrap<VirtBaseSH>(m,
160 "SH_rtrn_obj_cast_shared_ptr",
161 "SH_rtrn_potentially_slicing_shared_ptr",
162 "SH_SpOwner",
163 "SH_WpOwner");
164
165 wrap<VirtBaseSP>(m,
166 "SP_rtrn_obj_cast_shared_ptr",
167 "SP_rtrn_potentially_slicing_shared_ptr",
168 "SP_SpOwner",
169 "SP_WpOwner");
170}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected