Skip to content

Conversation

@junkmd
Copy link
Collaborator

@junkmd junkmd commented Jan 11, 2026

This introduces several enhancements to memory management utilities and extends the test coverage for IStorage and IStream interfaces.

  • Add new CoGetMalloc function to malloc.py:

    • Value: Centralizes IMalloc pointer retrieval into a high-level wrapper CoGetMalloc utility function. This ensures consistent and type-hinted access to the memory allocator across the codebase.
  • New Test for IStorage.SetElementTimes:

    • Value: Adds test coverage for the IStorage.SetElementTimes method. This new test verifies that modification times are correctly set for storage elements.
  • Memory Management Test Enhancements for IStorage.Stat and IStream.Stat:

    • Value: Introduces checks for pwcsName memory allocation within IStorage.Stat and IStream.Stat tests.
  • Enhance Validation in IStorage.Stat:

    • Value: Improves IStorage.Stat tests.

Ensures that the `pwcsName` field of the `tagSTATSTG` structure,
returned by `IStorage.Stat`, correctly reflects the file path
used during the creation of a compound file. This enhances the
`test_Stat` in `test_storage.py` by verifying the consistency of
the storage's reported name with its physical location.
Added validation for `ctime`, `atime`, and `mtime` `FILETIME` timestamps
within the `tagSTATSTG` structure in `test_storage.py`.
Introduced `test_SetElementTimes` in `test_storage.py` to verify
the functionality of the `IStorage.SetElementTimes` method.
Directly import `c_size_t` as `SIZE_T` from `ctypes` to remove an
unnecessary alias assignment, streamlining type definition.
…unction.

Introduced a `CoGetMalloc` utility function in `comtypes/malloc.py` to
encapsulate the low-level `_CoGetMalloc` API call. This new function
streamlines the acquisition of the OLE task memory allocator by
standardizing the `dwMemContext` parameter to `1`, which is the only
supported value for `CoGetMalloc`.
Removed assertions for `IMalloc.DidAlloc` after `del stat` in `test_storage.py`
and `test_stream.py`.
@junkmd junkmd added this to the 1.4.15 milestone Jan 11, 2026
@junkmd junkmd added enhancement New feature or request tests enhance or fix tests labels Jan 11, 2026
@codecov
Copy link

codecov bot commented Jan 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.68%. Comparing base (8c3bdec) to head (65dd0e5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #901      +/-   ##
==========================================
+ Coverage   85.61%   85.68%   +0.07%     
==========================================
  Files         128      128              
  Lines       12074    12137      +63     
==========================================
+ Hits        10337    10400      +63     
  Misses       1737     1737              

☔ 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.

@junkmd junkmd merged commit 1f5c5d5 into enthought:main Jan 11, 2026
138 of 150 checks passed
@junkmd junkmd deleted the stat_malloc_tests branch January 11, 2026 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request tests enhance or fix tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant