-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-127183: Add _ctypes.CopyComPointer
tests
#127184
Conversation
f48bcf1
to
638487b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
I see CopyComPointer
is undocumented. Would you be willing to add some documentation for it as well?
dst_orig = create_shelllink_persist(self.IPersist) | ||
dst = self.IPersist() | ||
CopyComPointer(dst_orig, byref(dst)) | ||
dst_orig.Release() # The refcount of `dst_orig` is 1 here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the refcount be checked using Release
's return value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, since this assertion is not costly, it is better to simply call assertEqual
than to leave a comment about it.
I have changed these lines.
That's my intention, but as discussed in gh-126686, I believe publicizing it is also necessary for proper documentation. Before moving forward with documentation or publicizing, I want to backport this test to 3.13 and 3.12, where |
* Make `create_shelllink_persist` top level function. * Add `CopyComPointerTests`. * Add more tests. * Update tests. * Add assertions for `Release`'s return value. (cherry picked from commit c7f1e3e) Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
GH-127251 is a backport of this pull request to the 3.13 branch. |
* Make `create_shelllink_persist` top level function. * Add `CopyComPointerTests`. * Add more tests. * Update tests. * Add assertions for `Release`'s return value. (cherry picked from commit c7f1e3e) Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
GH-127252 is a backport of this pull request to the 3.12 branch. |
Makes sense. Thank you for the test! |
…127251) gh-127183: Add `_ctypes.CopyComPointer` tests (GH-127184) * Make `create_shelllink_persist` top level function. * Add `CopyComPointerTests`. * Add more tests. * Update tests. * Add assertions for `Release`'s return value. (cherry picked from commit c7f1e3e) Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
…127252) gh-127183: Add `_ctypes.CopyComPointer` tests (GH-127184) * Make `create_shelllink_persist` top level function. * Add `CopyComPointerTests`. * Add more tests. * Update tests. * Add assertions for `Release`'s return value. (cherry picked from commit c7f1e3e) Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
I would like to backport this to 3.12 and 3.13 as well.
This is internal-only, so I don’t think it needs a NEWS entry.
_ctypes.CopyComPointer
. #127183