mirror of
https://github.com/pybind/pybind11.git
synced 2025-02-18 06:30:54 +00:00
Systematically renaming tests to use "class_sh" in the name.
This commit is contained in:
parent
bda4178163
commit
edfe8bfd71
@ -4,7 +4,7 @@
|
||||
#include <string>
|
||||
|
||||
namespace pybind11_tests {
|
||||
namespace classh_module_local {
|
||||
namespace class_sh_module_local {
|
||||
|
||||
struct atyp { // Short for "any type".
|
||||
std::string mtxt;
|
||||
@ -14,13 +14,13 @@ std::string get_mtxt(const atyp &obj) { return obj.mtxt; }
|
||||
|
||||
atyp rtrn_valu_atyp() { return atyp(); }
|
||||
|
||||
} // namespace classh_module_local
|
||||
} // namespace class_sh_module_local
|
||||
} // namespace pybind11_tests
|
||||
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::classh_module_local::atyp)
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_module_local::atyp)
|
||||
|
||||
PYBIND11_MODULE(classh_module_local_0, m) {
|
||||
using namespace pybind11_tests::classh_module_local;
|
||||
PYBIND11_MODULE(class_sh_module_local_0, m) {
|
||||
using namespace pybind11_tests::class_sh_module_local;
|
||||
|
||||
m.def("get_mtxt", get_mtxt);
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Identical to classh_module_local_2.cpp, except 2 replaced with 1.
|
||||
// Identical to class_sh_module_local_2.cpp, except 2 replaced with 1.
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/smart_holder.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace pybind11_tests {
|
||||
namespace classh_module_local {
|
||||
namespace class_sh_module_local {
|
||||
|
||||
struct atyp { // Short for "any type".
|
||||
std::string mtxt;
|
||||
@ -13,14 +13,14 @@ struct atyp { // Short for "any type".
|
||||
|
||||
std::string get_mtxt(const atyp &obj) { return obj.mtxt; }
|
||||
|
||||
} // namespace classh_module_local
|
||||
} // namespace class_sh_module_local
|
||||
} // namespace pybind11_tests
|
||||
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::classh_module_local::atyp)
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_module_local::atyp)
|
||||
|
||||
PYBIND11_MODULE(classh_module_local_1, m) {
|
||||
PYBIND11_MODULE(class_sh_module_local_1, m) {
|
||||
namespace py = pybind11;
|
||||
using namespace pybind11_tests::classh_module_local;
|
||||
using namespace pybind11_tests::class_sh_module_local;
|
||||
|
||||
py::class_<atyp, py::smart_holder>(m, "atyp", py::module_local())
|
||||
.def(py::init([](const std::string &mtxt) {
|
@ -1,11 +1,11 @@
|
||||
// Identical to classh_module_local_1.cpp, except 1 replaced with 2.
|
||||
// Identical to class_sh_module_local_1.cpp, except 1 replaced with 2.
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/smart_holder.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace pybind11_tests {
|
||||
namespace classh_module_local {
|
||||
namespace class_sh_module_local {
|
||||
|
||||
struct atyp { // Short for "any type".
|
||||
std::string mtxt;
|
||||
@ -13,14 +13,14 @@ struct atyp { // Short for "any type".
|
||||
|
||||
std::string get_mtxt(const atyp &obj) { return obj.mtxt; }
|
||||
|
||||
} // namespace classh_module_local
|
||||
} // namespace class_sh_module_local
|
||||
} // namespace pybind11_tests
|
||||
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::classh_module_local::atyp)
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_module_local::atyp)
|
||||
|
||||
PYBIND11_MODULE(classh_module_local_2, m) {
|
||||
PYBIND11_MODULE(class_sh_module_local_2, m) {
|
||||
namespace py = pybind11;
|
||||
using namespace pybind11_tests::classh_module_local;
|
||||
using namespace pybind11_tests::class_sh_module_local;
|
||||
|
||||
py::class_<atyp, py::smart_holder>(m, "atyp", py::module_local())
|
||||
.def(py::init([](const std::string &mtxt) {
|
@ -6,7 +6,7 @@
|
||||
#include <string>
|
||||
|
||||
namespace pybind11_tests {
|
||||
namespace classh_wip {
|
||||
namespace class_sh_basic {
|
||||
|
||||
struct atyp { // Short for "any type".
|
||||
std::string mtxt;
|
||||
@ -46,15 +46,15 @@ std::string pass_uqcp_atyp(std::unique_ptr<atyp const> obj) { return "pass_uqcp:
|
||||
std::string get_mtxt(atyp const &obj) { return obj.mtxt; }
|
||||
std::unique_ptr<atyp> unique_ptr_roundtrip(std::unique_ptr<atyp> obj) { return obj; }
|
||||
|
||||
} // namespace classh_wip
|
||||
} // namespace class_sh_basic
|
||||
} // namespace pybind11_tests
|
||||
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::classh_wip::atyp)
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_basic::atyp)
|
||||
|
||||
namespace pybind11_tests {
|
||||
namespace classh_wip {
|
||||
namespace class_sh_basic {
|
||||
|
||||
TEST_SUBMODULE(classh_wip, m) {
|
||||
TEST_SUBMODULE(class_sh_basic, m) {
|
||||
namespace py = pybind11;
|
||||
|
||||
py::class_<atyp, py::smart_holder>(m, "atyp")
|
||||
@ -97,5 +97,5 @@ TEST_SUBMODULE(classh_wip, m) {
|
||||
m.def("unique_ptr_roundtrip", unique_ptr_roundtrip); // pass_uqmp_atyp, rtrn_uqmp_atyp
|
||||
}
|
||||
|
||||
} // namespace classh_wip
|
||||
} // namespace class_sh_basic
|
||||
} // namespace pybind11_tests
|
@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import pytest
|
||||
|
||||
from pybind11_tests import classh_wip as m
|
||||
from pybind11_tests import class_sh_basic as m
|
||||
|
||||
|
||||
def test_atyp_constructors():
|
@ -5,7 +5,7 @@
|
||||
#include <memory>
|
||||
|
||||
namespace pybind11_tests {
|
||||
namespace classh_inheritance {
|
||||
namespace class_sh_inheritance {
|
||||
|
||||
template <int Id>
|
||||
struct base_template {
|
||||
@ -53,20 +53,20 @@ inline int pass_cptr_base2(base2 const *b) { return b->id() + 22; }
|
||||
inline int pass_cptr_drvd2(drvd2 const *d) { return d->id() + 23; }
|
||||
// clang-format on
|
||||
|
||||
} // namespace classh_inheritance
|
||||
} // namespace class_sh_inheritance
|
||||
} // namespace pybind11_tests
|
||||
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::classh_inheritance::base)
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::classh_inheritance::drvd)
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_inheritance::base)
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_inheritance::drvd)
|
||||
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::classh_inheritance::base1)
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::classh_inheritance::base2)
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::classh_inheritance::drvd2)
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_inheritance::base1)
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_inheritance::base2)
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_inheritance::drvd2)
|
||||
|
||||
namespace pybind11_tests {
|
||||
namespace classh_inheritance {
|
||||
namespace class_sh_inheritance {
|
||||
|
||||
TEST_SUBMODULE(classh_inheritance, m) {
|
||||
TEST_SUBMODULE(class_sh_inheritance, m) {
|
||||
py::class_<base, py::smart_holder>(m, "base");
|
||||
py::class_<drvd, base, py::smart_holder>(m, "drvd");
|
||||
|
||||
@ -95,5 +95,5 @@ TEST_SUBMODULE(classh_inheritance, m) {
|
||||
m.def("pass_cptr_drvd2", pass_cptr_drvd2);
|
||||
}
|
||||
|
||||
} // namespace classh_inheritance
|
||||
} // namespace class_sh_inheritance
|
||||
} // namespace pybind11_tests
|
@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from pybind11_tests import classh_inheritance as m
|
||||
from pybind11_tests import class_sh_inheritance as m
|
||||
|
||||
|
||||
def test_rtrn_mptr_drvd_pass_cptr_base():
|
@ -1,9 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import pytest
|
||||
|
||||
import classh_module_local_0 as m0
|
||||
import classh_module_local_1 as m1
|
||||
import classh_module_local_2 as m2
|
||||
import class_sh_module_local_0 as m0
|
||||
import class_sh_module_local_1 as m1
|
||||
import class_sh_module_local_2 as m2
|
||||
|
||||
|
||||
def test_cross_module_get_mtxt():
|
@ -5,7 +5,7 @@
|
||||
#include <memory>
|
||||
|
||||
namespace pybind11_tests {
|
||||
namespace unique_ptr_member {
|
||||
namespace class_sh_unique_ptr_member {
|
||||
|
||||
class pointee { // NOT copyable.
|
||||
public:
|
||||
@ -37,15 +37,15 @@ private:
|
||||
std::unique_ptr<pointee> ptr_;
|
||||
};
|
||||
|
||||
} // namespace unique_ptr_member
|
||||
} // namespace class_sh_unique_ptr_member
|
||||
} // namespace pybind11_tests
|
||||
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::unique_ptr_member::pointee)
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_unique_ptr_member::pointee)
|
||||
|
||||
namespace pybind11_tests {
|
||||
namespace unique_ptr_member {
|
||||
namespace class_sh_unique_ptr_member {
|
||||
|
||||
TEST_SUBMODULE(unique_ptr_member, m) {
|
||||
TEST_SUBMODULE(class_sh_unique_ptr_member, m) {
|
||||
py::class_<pointee, py::smart_holder>(m, "pointee")
|
||||
.def(py::init<>())
|
||||
.def("get_int", &pointee::get_int);
|
||||
@ -59,5 +59,5 @@ TEST_SUBMODULE(unique_ptr_member, m) {
|
||||
.def("give_up_ownership_via_shared_ptr", &ptr_owner::give_up_ownership_via_shared_ptr);
|
||||
}
|
||||
|
||||
} // namespace unique_ptr_member
|
||||
} // namespace class_sh_unique_ptr_member
|
||||
} // namespace pybind11_tests
|
@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import pytest
|
||||
|
||||
from pybind11_tests import unique_ptr_member as m
|
||||
from pybind11_tests import class_sh_unique_ptr_member as m
|
||||
|
||||
|
||||
def test_make_unique_pointee():
|
Loading…
Reference in New Issue
Block a user