Skip to content

Commit

Permalink
Clean out debug code in test_class_sh_mi_thunks.cpp,py
Browse files Browse the repository at this point in the history
  • Loading branch information
rwgk committed Jul 7, 2024
1 parent 011c795 commit 56019a2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
8 changes: 0 additions & 8 deletions tests/test_class_sh_mi_thunks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,13 @@ TEST_SUBMODULE(class_sh_mi_thunks, m) {
[]() {
auto *drvd = new Derived;
auto *base0 = dynamic_cast<Base0 *>(drvd);
printf("\nLOOOK get raw drvd %ld\n", (long) drvd); fflush(stdout); // NOLINT
printf("\nLOOOK get raw base %ld\n", (long) base0); fflush(stdout); // NOLINT
return base0;
},
py::return_value_policy::take_ownership);

m.def("get_drvd_as_base0_shared_ptr", []() {
auto drvd = std::make_shared<Derived>();
auto base0 = std::dynamic_pointer_cast<Base0>(drvd);
printf("\nLOOOK get shd drvd %ld\n", (long) drvd.get()); fflush(stdout); // NOLINT
printf("\nLOOOK get shd base %ld\n", (long) base0.get()); fflush(stdout); // NOLINT
return base0;
});

Expand All @@ -79,19 +75,15 @@ printf("\nLOOOK get shd base %ld\n", (long) base0.get()); fflush(stdout); // NO
});

m.def("vec_size_base0_raw_ptr", [](const Base0 *obj) {
printf("\nLOOOK raw const Base0 *obj %ld\n", (long) obj); fflush(stdout); // NOLINT
const auto *obj_der = dynamic_cast<const Derived *>(obj);
printf("\nLOOOK raw const auto *obj_der %ld\n", (long) obj_der); fflush(stdout); // NOLINT
if (obj_der == nullptr) {
return std::size_t(0);
}
return obj_der->vec.size();
});

m.def("vec_size_base0_shared_ptr", [](const std::shared_ptr<Base0> &obj) -> std::size_t {
printf("\nLOOOK shd const Base0 *obj %ld\n", (long) obj.get()); fflush(stdout); // NOLINT
const auto obj_der = std::dynamic_pointer_cast<Derived>(obj);
printf("\nLOOOK shd const auto *obj_der %ld\n", (long) obj_der.get()); fflush(stdout); // NOLINT
if (!obj_der) {
return std::size_t(0);
}
Expand Down
3 changes: 0 additions & 3 deletions tests/test_class_sh_mi_thunks.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@ def test_ptrdiff_drvd_base0():
],
)
def test_get_vec_size_raw_shared(get_fn, vec_size_fn):
print(f"\nLOOOK A", flush=True)
obj = get_fn()
print(f"\nLOOOK B", flush=True)
assert vec_size_fn(obj) == 5
print(f"\nLOOOK C", flush=True)


@pytest.mark.parametrize(
Expand Down

0 comments on commit 56019a2

Please sign in to comment.