Skip to content

Conversation

@junkmd
Copy link
Collaborator

@junkmd junkmd commented Jan 27, 2026

Overview

This pull request refactors and expands the test suite for type library creation and type information management.
Existing tests for ICreateTypeLib and ICreateTypeInfo have been moved to a new, dedicated file test/test_typeinfo_create.py, improving test organization and maintainability.

Enhanced Test Coverage

Comprehensive ICreateTypeLib2 and ITypeLib2 Verification

Previously, tests for CreateTypeLib covered basic documentation and library attributes.
This change introduces an expanded set of tests for ICreateTypeLib2.

Detailed ICreateTypeInfo Structure and Documentation Validation

The ICreateTypeInfo testing has been improved to cover various aspects of type information creation.
This now includes dedicated tests for ITypeInfo.GetDocumentation for functions and variables, TYPEATTR verification for interfaces and aliases, FUNCDESC and VARDESC validation, IMPLTYPEFLAG for coclasses, and DllEntry verification.

Improved Test Maintainability and Discoverability

By moving tests related to type library creation and modification into their own module test_typeinfo_create.py.

…ed file.

Move `Test_CreateTypeLib` and `Test_ICreateTypeInfo` from
`test/test_typeinfo.py` to `test/test_typeinfo_create.py`.
This improves test organization by separating concerns related to type library
creation into their own module.
This commit introduces the `ITypeLib2` interface definition and corresponding
tests within `test_typeinfo_create.py`. Specifically, `test_Documentation2`
and `test_CustData` are added to verify `ICreateTypeLib2`'s `SetDocString`,
`SetHelpStringContext`, `SetHelpStringDll`, and `SetCustData` methods.

The `ITypeLib2` definition is currently used for testing purposes to validate
values set by `ICreateTypeLib2`. It is not yet integrated into the production
codebase, and its direct adoption into production in this form is still under
consideration.
Adds `test_Func_Documentation` and `test_Var_Documentation` to
`test_typeinfo_create.py`. These tests verify that `ITypeInfo.GetDocumentation`
correctly retrieves documentation strings, help contexts, and names for
functions and variables, respectively, after being set via `ICreateTypeInfo`.
Add `test_Interface_TYPEATTR` and `test_Alias_TYPEATTR` to
`test/test_typeinfo_create.py`.
These tests verify that `ITypeInfo.GetTypeAttr` correctly retrieves the
`TYPEATTR` structure for interfaces and aliases.
Add `test_FUNCDESC` to `test/test_typeinfo_create.py`.
This test verifies the correct creation and retrieval of function descriptions
(`FUNCDESC`) for an interface within a type library.
Add `test_VARDESC` to `test/test_typeinfo_create.py`.
This test verifies the correct creation and retrieval of variable descriptions
(`VARDESC`) for a module within a type library.
Add `test_ImplTypeFlags` to `test/test_typeinfo_create.py`.
This test verifies the correct setting and retrieval of implementation type
flags (`IMPLTYPEFLAG`) for interfaces within a coclass using
`SetImplTypeFlags`.
Add `test_DllEntry` to `test/test_typeinfo_create.py`.
This test verifies the correct setting and retrieval of DLL entry information
for functions within a `TKIND_MODULE` type info using `DefineFuncAsDllEntry`.
@junkmd junkmd added this to the 1.4.16 milestone Jan 27, 2026
@junkmd junkmd added the tests enhance or fix tests label Jan 27, 2026
@codecov
Copy link

codecov bot commented Jan 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.53%. Comparing base (ebedd2e) to head (0602007).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #917      +/-   ##
==========================================
+ Coverage   87.30%   87.53%   +0.23%     
==========================================
  Files         135      136       +1     
  Lines       12766    12975     +209     
==========================================
+ Hits        11145    11358     +213     
+ Misses       1621     1617       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…stently.

The existing `test_Interface_TYPEATTR` was NOT suitable for testing the
explicit setting of alignment due to its reliance on system-dependent default
alignments, which led to failures in the CI.
To properly verify alignment settings, `test_Record_TYPEATTR` is added.

`test_Record_TYPEATTR` explicitly sets alignment to `1` for a `TKIND_RECORD`
containing `char` and `double` fields. This ensures the record's `cbAlignment`
and `cbSizeInstance`, guaranteeing consistent behavior across 32-bit and 64-bit
systems. This test demonstrates the correct usage of `SetAlignment` for
platform-independent layout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests enhance or fix tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant