Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
3da8ba64
Commit
3da8ba64
authored
Jan 15, 2021
by
Ralf W. Grosse-Kunstleve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inserting additional assert to ensure a returned unique_ptr is always a new Python instance.
parent
0a2373cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
tests/test_classh_wip.py
+6
-0
No files found.
tests/test_classh_wip.py
View file @
3da8ba64
...
...
@@ -70,7 +70,13 @@ def test_pass_unique_ptr_disowns(pass_mpty, argm, rtrn):
def
test_unique_ptr_roundtrip
(
num_round_trips
=
1000
):
# Multiple roundtrips to stress-test instance registration/deregistration.
recycled
=
m
.
mpty
(
"passenger"
)
for
_
in
range
(
num_round_trips
):
id_orig
=
id
(
recycled
)
recycled
=
m
.
unique_ptr_roundtrip
(
recycled
)
assert
m
.
get_mtxt
(
recycled
)
==
"passenger"
id_rtrn
=
id
(
recycled
)
# Ensure the returned object is a different Python instance.
assert
id_rtrn
!=
id_orig
id_orig
=
id_rtrn
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment