Commit 1d89835
[NFC] Make status test macros take ownership of iree_status_t. (#23276)
Adds `ConsumeForTest` overloads that wrap raw `iree_status_t` in
`iree::Status` RAII wrappers, ensuring automatic cleanup on test
failure. The macros `IREE_EXPECT_OK`, `IREE_ASSERT_OK`,
`IREE_EXPECT_STATUS_IS`, and `IREE_ASSERT_STATUS_IS` now consume the
status they test.
For lvalue status variables, the source is cleared to a code-only value
so any existing `iree_status_ignore`/`iree_status_free` calls become
harmless no-ops. This allows incremental migration without breaking
existing tests.
Most tests (outside of tokenizer) have been updated. tokenizer is being
reworked and the next feature branch merge will adopt this behavior.
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 1a912be commit 1d89835
12 files changed
Lines changed: 260 additions & 289 deletions
File tree
- runtime/src/iree
- base
- internal
- testing
- hal/cts
- task
- testing
- vm
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
| |||
0 commit comments