From 2600bb67c5212feadb0502f2b331f2c662bd5bd0 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Sat, 13 Jul 2024 00:35:26 -0700 Subject: [PATCH] Remove test_ccccccccccccccccccccc.cpp,py (not needed anymore). --- tests/CMakeLists.txt | 1 - tests/test_ccccccccccccccccccccc.cpp | 104 --------------------------- tests/test_ccccccccccccccccccccc.py | 13 ---- 3 files changed, 118 deletions(-) delete mode 100644 tests/test_ccccccccccccccccccccc.cpp delete mode 100644 tests/test_ccccccccccccccccccccc.py diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 83e058f4c..b79e755e4 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -117,7 +117,6 @@ set(PYBIND11_TEST_FILES test_builtin_casters test_call_policies test_callbacks - test_ccccccccccccccccccccc test_chrono test_class test_class_sh_basic diff --git a/tests/test_ccccccccccccccccccccc.cpp b/tests/test_ccccccccccccccccccccc.cpp deleted file mode 100644 index 1c0526ee1..000000000 --- a/tests/test_ccccccccccccccccccccc.cpp +++ /dev/null @@ -1,104 +0,0 @@ -#include - -#include "pybind11_tests.h" - -#include - -namespace pybind11_tests { -namespace ccccccccccccccccccccc { - -// Diamond inheritance (copied from test_multiple_inheritance.cpp). -struct B { - int val_b = 10; - B() = default; - B(const B &) = default; - virtual ~B() = default; -}; - -struct C0 : public virtual B { - int val_c0 = 20; -}; - -struct C1 : public virtual B { - int val_c1 = 21; -}; - -struct D : public C0, public C1 { - int val_d = 30; -}; - -void disown_b(std::unique_ptr) {} - -const std::string fooNames[] = {"ShPtr_"}; - -template -struct Foo { - std::string history; - explicit Foo(const std::string &history_) : history(history_) {} - Foo(const Foo &other) : history(other.history + "_CpCtor") {} - Foo(Foo &&other) noexcept : history(other.history + "_MvCtor") {} - Foo &operator=(const Foo &other) { - history = other.history + "_OpEqLv"; - return *this; - } - Foo &operator=(Foo &&other) noexcept { - history = other.history + "_OpEqRv"; - return *this; - } - std::string get_history() const { return "Foo" + fooNames[SerNo] + history; } -}; - -using FooShPtr = Foo<0>; - -} // namespace ccccccccccccccccccccc -} // namespace pybind11_tests - -PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::ccccccccccccccccccccc::B) -PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::ccccccccccccccccccccc::C0) -PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::ccccccccccccccccccccc::C1) -PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::ccccccccccccccccccccc::D) - -PYBIND11_TYPE_CASTER_BASE_HOLDER(pybind11_tests::ccccccccccccccccccccc::FooShPtr, - std::shared_ptr) - -TEST_SUBMODULE(ccccccccccccccccccccc, m) { - using namespace pybind11_tests::ccccccccccccccccccccc; - - py::class_>(m, "FooShPtr") - .def("get_history", &FooShPtr::get_history); - - m.def("test_ShPtr_copy", []() { - auto o = std::make_shared("copy"); - auto l = py::list(); - l.append(o); - return l; - }); - - py::classh(m, "B") - .def(py::init<>()) - .def_readonly("val_b", &D::val_b) - .def("b", [](B *self) { return self; }) - .def("get", [](const B &self) { return self.val_b; }); - - py::classh(m, "C0") - .def(py::init<>()) - .def_readonly("val_c0", &D::val_c0) - .def("c0", [](C0 *self) { return self; }) - .def("get", [](const C0 &self) { return self.val_b * 100 + self.val_c0; }); - - py::classh(m, "C1") - .def(py::init<>()) - .def_readonly("val_c1", &D::val_c1) - .def("c1", [](C1 *self) { return self; }) - .def("get", [](const C1 &self) { return self.val_b * 100 + self.val_c1; }); - - py::classh(m, "D") - .def(py::init<>()) - .def_readonly("val_d", &D::val_d) - .def("d", [](D *self) { return self; }) - .def("get", [](const D &self) { - return self.val_b * 1000000 + self.val_c0 * 10000 + self.val_c1 * 100 + self.val_d; - }); - - m.def("disown_b", disown_b); -} diff --git a/tests/test_ccccccccccccccccccccc.py b/tests/test_ccccccccccccccccccccc.py deleted file mode 100644 index 82e0a1754..000000000 --- a/tests/test_ccccccccccccccccccccc.py +++ /dev/null @@ -1,13 +0,0 @@ -from __future__ import annotations - -import env # noqa: F401 -from pybind11_tests import ccccccccccccccccccccc as m - - -def test_disown_d(): - d = m.D() - m.disown_b(d) - - -def test_shptr_copy(): - m.test_ShPtr_copy()