mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 06:35:12 +00:00
After clang-format (via pre-commit).
This commit is contained in:
parent
2ba40fc50b
commit
d07865846c
@ -354,9 +354,7 @@ TEST_SUBMODULE(class_, m) {
|
|||||||
using ProtectedA::foo;
|
using ProtectedA::foo;
|
||||||
};
|
};
|
||||||
|
|
||||||
py::class_<ProtectedA>(m, "ProtectedA")
|
py::class_<ProtectedA>(m, "ProtectedA").def(py::init<>()).def("foo", &PublicistA::foo);
|
||||||
.def(py::init<>())
|
|
||||||
.def("foo", &PublicistA::foo);
|
|
||||||
|
|
||||||
class ProtectedB {
|
class ProtectedB {
|
||||||
public:
|
public:
|
||||||
|
@ -5,44 +5,44 @@
|
|||||||
#include "pybind11_tests.h"
|
#include "pybind11_tests.h"
|
||||||
|
|
||||||
// IUT = Implementation Under Test
|
// IUT = Implementation Under Test
|
||||||
# define CONST_NAME_TESTS(TEST_FUNC, IUT) \
|
#define CONST_NAME_TESTS(TEST_FUNC, IUT) \
|
||||||
std::string TEST_FUNC(int selector) { \
|
std::string TEST_FUNC(int selector) { \
|
||||||
switch (selector) { \
|
switch (selector) { \
|
||||||
case 0: \
|
case 0: \
|
||||||
return IUT("").text; \
|
return IUT("").text; \
|
||||||
case 1: \
|
case 1: \
|
||||||
return IUT("A").text; \
|
return IUT("A").text; \
|
||||||
case 2: \
|
case 2: \
|
||||||
return IUT("Bd").text; \
|
return IUT("Bd").text; \
|
||||||
case 3: \
|
case 3: \
|
||||||
return IUT("Cef").text; \
|
return IUT("Cef").text; \
|
||||||
case 4: \
|
case 4: \
|
||||||
return IUT<int>().text; /*NOLINT(bugprone-macro-parentheses)*/ \
|
return IUT<int>().text; /*NOLINT(bugprone-macro-parentheses)*/ \
|
||||||
case 5: \
|
case 5: \
|
||||||
return IUT<std::string>().text; /*NOLINT(bugprone-macro-parentheses)*/ \
|
return IUT<std::string>().text; /*NOLINT(bugprone-macro-parentheses)*/ \
|
||||||
case 6: \
|
case 6: \
|
||||||
return IUT<true>("T1", "T2").text; /*NOLINT(bugprone-macro-parentheses)*/ \
|
return IUT<true>("T1", "T2").text; /*NOLINT(bugprone-macro-parentheses)*/ \
|
||||||
case 7: \
|
case 7: \
|
||||||
return IUT<false>("U1", "U2").text; /*NOLINT(bugprone-macro-parentheses)*/ \
|
return IUT<false>("U1", "U2").text; /*NOLINT(bugprone-macro-parentheses)*/ \
|
||||||
case 8: \
|
case 8: \
|
||||||
/*NOLINTNEXTLINE(bugprone-macro-parentheses)*/ \
|
/*NOLINTNEXTLINE(bugprone-macro-parentheses)*/ \
|
||||||
return IUT<true>(IUT("D1"), IUT("D2")).text; \
|
return IUT<true>(IUT("D1"), IUT("D2")).text; \
|
||||||
case 9: \
|
case 9: \
|
||||||
/*NOLINTNEXTLINE(bugprone-macro-parentheses)*/ \
|
/*NOLINTNEXTLINE(bugprone-macro-parentheses)*/ \
|
||||||
return IUT<false>(IUT("E1"), IUT("E2")).text; \
|
return IUT<false>(IUT("E1"), IUT("E2")).text; \
|
||||||
case 10: \
|
case 10: \
|
||||||
return IUT("KeepAtEnd").text; \
|
return IUT("KeepAtEnd").text; \
|
||||||
default: \
|
default: \
|
||||||
break; \
|
break; \
|
||||||
} \
|
} \
|
||||||
throw std::runtime_error("Invalid selector value."); \
|
throw std::runtime_error("Invalid selector value."); \
|
||||||
}
|
}
|
||||||
|
|
||||||
CONST_NAME_TESTS(const_name_tests, py::detail::const_name)
|
CONST_NAME_TESTS(const_name_tests, py::detail::const_name)
|
||||||
|
|
||||||
# ifdef PYBIND11_DETAIL_UNDERSCORE_BACKWARD_COMPATIBILITY
|
#ifdef PYBIND11_DETAIL_UNDERSCORE_BACKWARD_COMPATIBILITY
|
||||||
CONST_NAME_TESTS(underscore_tests, py::detail::_)
|
CONST_NAME_TESTS(underscore_tests, py::detail::_)
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
TEST_SUBMODULE(const_name, m) {
|
TEST_SUBMODULE(const_name, m) {
|
||||||
m.def("const_name_tests", const_name_tests);
|
m.def("const_name_tests", const_name_tests);
|
||||||
|
Loading…
Reference in New Issue
Block a user