Closed guitargeek closed 5 months ago
This test should restore the old global policy (returned by SetMemoryPolicy
) or it risks messing up other tests. Furthermore, the whole test should be in a try
/except
/finally
with that restore in the finally
to make sure it is always run, even if the test fails.
The SetMemoryPolicy
just returns None
, not the old policy:
https://github.com/wlav/CPyCppyy/blob/master/src/CPyCppyyModule.cxx#L882
Is there another way to get it?
Code now returns the old policy.
Thanks a lot @wlav! I have updated the test as you suggested.
Regression test covering the problem reported in #221.
The regression was that the caller gave up ownership also in the case of
const ptr
, which is not the original behavior of cppyy, i.e. the behavior that ROOT came to expect.The fix that makes this test pass is provided in this PR: https://github.com/wlav/CPyCppyy/pull/22