diff --git a/tests/test_numpy_dtypes.cpp b/tests/test_numpy_dtypes.cpp index 40aca0c3..8f680c07 100644 --- a/tests/test_numpy_dtypes.cpp +++ b/tests/test_numpy_dtypes.cpp @@ -67,6 +67,11 @@ struct StringStruct { std::array b; }; +PYBIND11_PACKED(struct StructWithUglyNames { + int8_t __x__; + uint64_t __y__; +}); + enum class E1 : int64_t { A = -1, B = 1 }; enum E2 : uint8_t { X = 1, Y = 2 }; @@ -197,7 +202,8 @@ py::list print_dtypes() { py::dtype::of().str(), py::dtype::of().str(), py::dtype::of().str(), - py::dtype::of().str() + py::dtype::of().str(), + py::dtype::of().str() }; auto l = py::list(); for (const auto &s : dtypes) { @@ -312,6 +318,8 @@ test_initializer numpy_dtypes([](py::module &m) { // ... or after py::class_(m, "PackedStruct"); + PYBIND11_NUMPY_DTYPE_EX(StructWithUglyNames, __x__, "x", __y__, "y"); + m.def("create_rec_simple", &create_recarray); m.def("create_rec_packed", &create_recarray); m.def("create_rec_nested", &create_nested); diff --git a/tests/test_numpy_dtypes.py b/tests/test_numpy_dtypes.py index 47d7c3bd..b4e6d71f 100644 --- a/tests/test_numpy_dtypes.py +++ b/tests/test_numpy_dtypes.py @@ -42,7 +42,8 @@ def test_dtype(): "{'names':['x','y','z'], 'formats':['?','