Repository navigation
test: document problems with the current VT_I1 mapping in tlbparser.
#962
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
Merged
junkmd
merged 8 commits into
enthought:main
from
haoxuanjng-lang:fix/typelib-signed-int8
Oct 18, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
17289d0
fix: generate signed byte types for VT_I1
haoxuanjng-lang 8b79673
test: exercise byte types across native COM boundary
haoxuanjng-lang bae7ba2
test: expand bidirectional byte compatibility coverage and merge main
haoxuanjng-lang a98cbab
test: separate legacy and proposed byte mapping cases
haoxuanjng-lang 05003af
Merge main and retain byte and VT_ERROR native fixtures
haoxuanjng-lang e4e6257
Compare legacy and proposed byte interfaces in native tests
haoxuanjng-lang c4d222c
Organize VT_I1 compatibility tests by method and error path
haoxuanjng-lang 379ef3e
test: preserve VT_I1 mapping and document current defects
haoxuanjng-lang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
566 changes: 566 additions & 0 deletions
566
comtypes/test/test_compatibility_tlbparser_VT_I1_assignment.py
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| #include <objbase.h> | ||
| #include <string.h> | ||
| #include "CoByteCompatibilityTest.h" | ||
|
|
||
| HRESULT CByteCompatibilityTest::CreateInstance(IUnknown* pUnknownOuter, CUnknown** ppNewComponent) | ||
| { | ||
| if (pUnknownOuter != NULL) | ||
| { | ||
| return CLASS_E_NOAGGREGATION ; | ||
| } | ||
| *ppNewComponent = new CByteCompatibilityTest(pUnknownOuter) ; | ||
| return S_OK ; | ||
| } | ||
|
|
||
| HRESULT __stdcall CByteCompatibilityTest::NondelegatingQueryInterface(const IID& iid, void** ppv) | ||
| { | ||
| if (iid == IID_IByteCompatibilityTest) | ||
| { | ||
| return FinishQI(static_cast<IByteCompatibilityTest*>(this), ppv) ; | ||
| } | ||
| return CUnknown::NondelegatingQueryInterface(iid, ppv) ; | ||
| } | ||
|
|
||
| HRESULT __stdcall CByteCompatibilityTest::EchoInt8(char value, char* result) | ||
| { | ||
| if (result == NULL) | ||
| { | ||
| return E_POINTER ; | ||
| } | ||
| *result = value ; | ||
| return S_OK ; | ||
| } | ||
|
|
||
| HRESULT __stdcall CByteCompatibilityTest::EchoUint8(byte value, byte* result) | ||
| { | ||
| if (result == NULL) | ||
| { | ||
| return E_POINTER ; | ||
| } | ||
| *result = value ; | ||
| return S_OK ; | ||
| } | ||
|
|
||
| HRESULT __stdcall CByteCompatibilityTest::EchoLpStr(LPSTR value, LPSTR* result) | ||
| { | ||
| if (result == NULL) | ||
| { | ||
| return E_POINTER ; | ||
| } | ||
| *result = NULL ; | ||
| if (value == NULL) | ||
| { | ||
| return E_INVALIDARG ; | ||
| } | ||
| size_t size = strlen(value) + 1 ; | ||
| *result = static_cast<LPSTR>(CoTaskMemAlloc(size)) ; | ||
| if (*result == NULL) | ||
| { | ||
| return E_OUTOFMEMORY ; | ||
| } | ||
| memcpy(*result, value, size) ; | ||
| return S_OK ; | ||
| } | ||
|
|
||
| HRESULT __stdcall CByteCompatibilityTest::ReadCharPointer(unsigned char* value, byte* result) | ||
| { | ||
| if (value == NULL || result == NULL) | ||
| { | ||
| return E_POINTER ; | ||
| } | ||
| // A raw char* marshals one character, not a NUL-terminated string. | ||
| *result = static_cast<byte>(*value) ; | ||
| return S_OK ; | ||
| } | ||
|
|
||
| HRESULT __stdcall CByteCompatibilityTest::GetCharacterBytes(byte value, unsigned char* result) | ||
| { | ||
| if (result == NULL) | ||
| { | ||
| return E_POINTER ; | ||
| } | ||
| *result = value ; | ||
| return S_OK ; | ||
| } |
|
junkmd marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| // A separate COM component for byte and narrow-string compatibility. | ||
| #include "CUnknown.h" | ||
| #include "Iface.h" | ||
|
|
||
| class CByteCompatibilityTest : public CUnknown, public IByteCompatibilityTest | ||
| { | ||
| public: | ||
| static HRESULT CreateInstance(IUnknown* pUnknownOuter, CUnknown** ppNewComponent) ; | ||
|
|
||
| private: | ||
| DECLARE_IUNKNOWN | ||
| virtual HRESULT __stdcall NondelegatingQueryInterface(const IID& iid, void** ppv) ; | ||
| virtual HRESULT __stdcall EchoInt8(char value, char* result) ; | ||
| virtual HRESULT __stdcall EchoUint8(byte value, byte* result) ; | ||
| virtual HRESULT __stdcall EchoLpStr(LPSTR value, LPSTR* result) ; | ||
| virtual HRESULT __stdcall ReadCharPointer(unsigned char* value, byte* result) ; | ||
| virtual HRESULT __stdcall GetCharacterBytes(byte value, unsigned char* result) ; | ||
|
|
||
| CByteCompatibilityTest(IUnknown* pUnknownOuter) : CUnknown(pUnknownOuter) {} ; | ||
| } ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.