Skip to content

Commit d078658

Browse files
committed
After clang-format (via pre-commit).
1 parent 2ba40fc commit d078658

File tree

2 files changed

+35
-37
lines changed

2 files changed

+35
-37
lines changed

tests/test_class.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,7 @@ TEST_SUBMODULE(class_, m) {
354354
using ProtectedA::foo;
355355
};
356356

357-
py::class_<ProtectedA>(m, "ProtectedA")
358-
.def(py::init<>())
359-
.def("foo", &PublicistA::foo);
357+
py::class_<ProtectedA>(m, "ProtectedA").def(py::init<>()).def("foo", &PublicistA::foo);
360358

361359
class ProtectedB {
362360
public:

tests/test_const_name.cpp

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,44 @@
55
#include "pybind11_tests.h"
66

77
// IUT = Implementation Under Test
8-
# define CONST_NAME_TESTS(TEST_FUNC, IUT) \
9-
std::string TEST_FUNC(int selector) { \
10-
switch (selector) { \
11-
case 0: \
12-
return IUT("").text; \
13-
case 1: \
14-
return IUT("A").text; \
15-
case 2: \
16-
return IUT("Bd").text; \
17-
case 3: \
18-
return IUT("Cef").text; \
19-
case 4: \
20-
return IUT<int>().text; /*NOLINT(bugprone-macro-parentheses)*/ \
21-
case 5: \
22-
return IUT<std::string>().text; /*NOLINT(bugprone-macro-parentheses)*/ \
23-
case 6: \
24-
return IUT<true>("T1", "T2").text; /*NOLINT(bugprone-macro-parentheses)*/ \
25-
case 7: \
26-
return IUT<false>("U1", "U2").text; /*NOLINT(bugprone-macro-parentheses)*/ \
27-
case 8: \
28-
/*NOLINTNEXTLINE(bugprone-macro-parentheses)*/ \
29-
return IUT<true>(IUT("D1"), IUT("D2")).text; \
30-
case 9: \
31-
/*NOLINTNEXTLINE(bugprone-macro-parentheses)*/ \
32-
return IUT<false>(IUT("E1"), IUT("E2")).text; \
33-
case 10: \
34-
return IUT("KeepAtEnd").text; \
35-
default: \
36-
break; \
37-
} \
38-
throw std::runtime_error("Invalid selector value."); \
39-
}
8+
#define CONST_NAME_TESTS(TEST_FUNC, IUT) \
9+
std::string TEST_FUNC(int selector) { \
10+
switch (selector) { \
11+
case 0: \
12+
return IUT("").text; \
13+
case 1: \
14+
return IUT("A").text; \
15+
case 2: \
16+
return IUT("Bd").text; \
17+
case 3: \
18+
return IUT("Cef").text; \
19+
case 4: \
20+
return IUT<int>().text; /*NOLINT(bugprone-macro-parentheses)*/ \
21+
case 5: \
22+
return IUT<std::string>().text; /*NOLINT(bugprone-macro-parentheses)*/ \
23+
case 6: \
24+
return IUT<true>("T1", "T2").text; /*NOLINT(bugprone-macro-parentheses)*/ \
25+
case 7: \
26+
return IUT<false>("U1", "U2").text; /*NOLINT(bugprone-macro-parentheses)*/ \
27+
case 8: \
28+
/*NOLINTNEXTLINE(bugprone-macro-parentheses)*/ \
29+
return IUT<true>(IUT("D1"), IUT("D2")).text; \
30+
case 9: \
31+
/*NOLINTNEXTLINE(bugprone-macro-parentheses)*/ \
32+
return IUT<false>(IUT("E1"), IUT("E2")).text; \
33+
case 10: \
34+
return IUT("KeepAtEnd").text; \
35+
default: \
36+
break; \
37+
} \
38+
throw std::runtime_error("Invalid selector value."); \
39+
}
4040

4141
CONST_NAME_TESTS(const_name_tests, py::detail::const_name)
4242

43-
# ifdef PYBIND11_DETAIL_UNDERSCORE_BACKWARD_COMPATIBILITY
43+
#ifdef PYBIND11_DETAIL_UNDERSCORE_BACKWARD_COMPATIBILITY
4444
CONST_NAME_TESTS(underscore_tests, py::detail::_)
45-
# endif
45+
#endif
4646

4747
TEST_SUBMODULE(const_name, m) {
4848
m.def("const_name_tests", const_name_tests);

0 commit comments

Comments
 (0)