mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 14:45:12 +00:00
Remove redundant test_class_sh_property_bakein.cpp,py
This commit is contained in:
parent
84f71f1b69
commit
9f9a698ee9
@ -132,7 +132,6 @@ set(PYBIND11_TEST_FILES
|
||||
test_class_sh_mi_thunks
|
||||
test_class_sh_module_local.py
|
||||
test_class_sh_property
|
||||
test_class_sh_property_bakein
|
||||
test_class_sh_property_non_owning
|
||||
test_class_sh_shared_ptr_copy_move
|
||||
test_class_sh_trampoline_basic
|
||||
|
@ -1,35 +0,0 @@
|
||||
#include "pybind11_tests.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
namespace test_class_sh_property_bakein {
|
||||
|
||||
struct WithCharArrayMember {
|
||||
WithCharArrayMember() { std::memcpy(char6_member, "Char6", 6); }
|
||||
char char6_member[6];
|
||||
};
|
||||
|
||||
struct WithConstCharPtrMember {
|
||||
const char *const_char_ptr_member = "ConstChar*";
|
||||
};
|
||||
|
||||
} // namespace test_class_sh_property_bakein
|
||||
|
||||
TEST_SUBMODULE(class_sh_property_bakein, m) {
|
||||
m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") =
|
||||
#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT
|
||||
false;
|
||||
#else
|
||||
true;
|
||||
|
||||
using namespace test_class_sh_property_bakein;
|
||||
|
||||
py::class_<WithCharArrayMember>(m, "WithCharArrayMember")
|
||||
.def(py::init<>())
|
||||
.def_readonly("char6_member", &WithCharArrayMember::char6_member);
|
||||
|
||||
py::class_<WithConstCharPtrMember>(m, "WithConstCharPtrMember")
|
||||
.def(py::init<>())
|
||||
.def_readonly("const_char_ptr_member", &WithConstCharPtrMember::const_char_ptr_member);
|
||||
#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from pybind11_tests import class_sh_property_bakein as m
|
||||
|
||||
if not m.defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT:
|
||||
pytest.skip("smart_holder not available.", allow_module_level=True)
|
||||
|
||||
|
||||
def test_readonly_char6_member():
|
||||
obj = m.WithCharArrayMember()
|
||||
assert obj.char6_member == "Char6"
|
||||
|
||||
|
||||
def test_readonly_const_char_ptr_member():
|
||||
obj = m.WithConstCharPtrMember()
|
||||
assert obj.const_char_ptr_member == "ConstChar*"
|
Loading…
Reference in New Issue
Block a user