test(device_instance): add imu_name ownership ordering regression test#195
test(device_instance): add imu_name ownership ordering regression test#195BANANASJIM merged 1 commit intomainfrom
Conversation
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one. |
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThe PR adds a new regression test verifying that Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
8f36986 to
ecf8d2b
Compare
ecf8d2b to
ac71376
Compare
Adds a recording-allocator harness that captures the order of allocator.destroy(imu_dev) and allocator.free(imu_name_owned) during DeviceInstance.deinit. Also reads the UHID_DESTROY opcode from the pipe to confirm close() ran. Any future reordering of the deinit body will flip the log entries and fail the assertions. refs: architecture-review-v0.1.4.md finding #9
ac71376 to
6879228
Compare
Summary
src/test/device_instance_imu_ownership_test.zigwith a recording-allocator harnessrawFreecalls and records the order ofdestroy(imu_dev)vsfree(imu_name_owned)in a global event logUHID_DESTROYopcode from the pipe write-end to confirmimu_dev.close()actually ranbuild.zigas an independentb.addTestmodule (same pattern assupervisor_uhid_routing_test.zig), hooked totest_steptesting_supportinsrc/main.zigfor module graph completenessTest plan
zig buildcompiles cleanly (no errors)zig build check-fmtpassesfree(imu_name_owned)beforedestroy(imu_dev)),g_log[0]becomesfree_imu_nameandexpectEqual(destroy_imu_dev, g_log[0])failsimu_dev.close()is skipped,UHID_DESTROYread returns 0 bytes andexpect(n >= @sizeOf(u32))failsrefs: architecture-review-v0.1.4.md finding #9 (option B)
Summary by CodeRabbit