Commit 1f5c5d5
authored
* test: Validate `pwcsName` in `IStorage.Stat` for created files
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.
* test: Verify `tagSTATSTG.pwcsName` memory management in `IStorage` and `IStream` tests.
* test: Validate `FILETIME` in `IStorage.Stat` test.
Added validation for `ctime`, `atime`, and `mtime` `FILETIME` timestamps
within the `tagSTATSTG` structure in `test_storage.py`.
* test: Add `IStorage.SetElementTimes` functionality test.
Introduced `test_SetElementTimes` in `test_storage.py` to verify
the functionality of the `IStorage.SetElementTimes` method.
* refactor: Rename `statstg` to `stat` in `test_stream.py`.
* refactor: Improve `SIZE_T` import in `malloc.py`.
Directly import `c_size_t` as `SIZE_T` from `ctypes` to remove an
unnecessary alias assignment, streamlining type definition.
* refactor: Centralize `IMalloc` retrieval with `CoGetMalloc` utility function.
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`.
* fix: Remove `DidAlloc` checks on freed memory in `STATSTG` tests.
Removed assertions for `IMalloc.DidAlloc` after `del stat` in `test_storage.py`
and `test_stream.py`.
1 parent 8c3bdec commit 1f5c5d5
File tree
5 files changed
+157
-32
lines changed- comtypes
- test
5 files changed
+157
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | | - | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | 27 | | |
35 | 28 | | |
36 | | - | |
| 29 | + | |
37 | 30 | | |
38 | 31 | | |
39 | 32 | | |
| |||
59 | 52 | | |
60 | 53 | | |
61 | 54 | | |
62 | | - | |
| 55 | + | |
63 | 56 | | |
64 | 57 | | |
65 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
4 | | - | |
5 | | - | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
14 | 43 | | |
15 | 44 | | |
16 | 45 | | |
| |||
36 | 65 | | |
37 | 66 | | |
38 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
39 | 82 | | |
40 | 83 | | |
41 | 84 | | |
| |||
48 | 91 | | |
49 | 92 | | |
50 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
51 | 98 | | |
52 | 99 | | |
53 | 100 | | |
54 | 101 | | |
55 | 102 | | |
56 | | - | |
| 103 | + | |
| 104 | + | |
57 | 105 | | |
58 | 106 | | |
59 | 107 | | |
| |||
67 | 115 | | |
68 | 116 | | |
69 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
70 | 124 | | |
71 | 125 | | |
72 | 126 | | |
| |||
148 | 202 | | |
149 | 203 | | |
150 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
151 | 231 | | |
152 | 232 | | |
153 | 233 | | |
| |||
176 | 256 | | |
177 | 257 | | |
178 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
179 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
180 | 276 | | |
181 | 277 | | |
182 | 278 | | |
| |||
185 | 281 | | |
186 | 282 | | |
187 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | | - | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
113 | 118 | | |
114 | 119 | | |
115 | 120 | | |
| |||
206 | 211 | | |
207 | 212 | | |
208 | 213 | | |
209 | | - | |
| 214 | + | |
210 | 215 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
216 | 221 | | |
217 | 222 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
222 | 233 | | |
223 | 234 | | |
224 | 235 | | |
| |||
274 | 285 | | |
275 | 286 | | |
276 | 287 | | |
277 | | - | |
| 288 | + | |
| 289 | + | |
278 | 290 | | |
279 | 291 | | |
280 | 292 | | |
281 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
282 | 300 | | |
283 | 301 | | |
284 | 302 | | |
| |||
0 commit comments