gh-127183: Add _ctypes.CopyComPointer tests#127184
Conversation
f48bcf1 to
638487b
Compare
encukou
left a comment
There was a problem hiding this comment.
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.
Could the refcount be checked using Release's return value?
There was a problem hiding this comment.
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>
* Make `create_shelllink_persist` top level function. * Add `CopyComPointerTests`. * Add more tests. * Update tests. * Add assertions for `Release`'s return value.
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