mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-13 09:46:10 +00:00
Adding tests to exercise corner cases involving disowning. (#2912)
* Adding test_class_sh_disowning. * Fixing minor namespace naming inconsistency between test_class_sh_*.cpp files. * Replacing py::overload_cast with plain cast for C++11 compatibility. * Accommodate that the C++ order of evaluation of function arguments is unspecified.
This commit is contained in:
committed by
GitHub
parent
5319ca3817
commit
08339d6331
@@ -5,7 +5,7 @@
|
||||
#include <memory>
|
||||
|
||||
namespace pybind11_tests {
|
||||
namespace test_class_sh_with_alias {
|
||||
namespace class_sh_with_alias {
|
||||
|
||||
template <int SerNo> // Using int as a trick to easily generate a series of types.
|
||||
struct Abase {
|
||||
@@ -73,14 +73,14 @@ void wrap(py::module_ m, const char *py_class_name) {
|
||||
m.def("AddInCppUniquePtr", AddInCppUniquePtr<SerNo>, py::arg("obj"), py::arg("other_val"));
|
||||
}
|
||||
|
||||
} // namespace test_class_sh_with_alias
|
||||
} // namespace class_sh_with_alias
|
||||
} // namespace pybind11_tests
|
||||
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::test_class_sh_with_alias::Abase<0>)
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::test_class_sh_with_alias::Abase<1>)
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_with_alias::Abase<0>)
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_with_alias::Abase<1>)
|
||||
|
||||
TEST_SUBMODULE(class_sh_with_alias, m) {
|
||||
using namespace pybind11_tests::test_class_sh_with_alias;
|
||||
using namespace pybind11_tests::class_sh_with_alias;
|
||||
wrap<0>(m, "Abase0");
|
||||
wrap<1>(m, "Abase1");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user