test(pkcs11-mock): cover invalid-handle paths, domain constant, and copy/clone semantics#707
Conversation
…opy/clone semantics - Pin DOMAIN_PKCS11_MOCK to "uselesskey:pkcs11:mock:v1" so a rename trips CI. - Cover sign/verify/certificate_der/key_label error paths with unknown KeyHandle values. - Assert KeyHandle Copy/Clone produce equal-comparing values usable in HashMap/HashSet. - Round-trip SlotTokenInfo through Clone, Debug, and equality (incl. divergence after mutation). - Multi-step monotonicity assertion for next_sign_count pinning the +1 semantic. - Add uselesskey-test-support dev-dep; new tests use TestResult/require_ok/require_some. https://claude.ai/code/session_TODO Co-authored-by: Claude <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
✨ 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. Comment |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
Closes inline test-coverage gaps in
uselesskey-pkcs11-mockwithout touching production code.DOMAIN_PKCS11_MOCK = "uselesskey:pkcs11:mock:v1"so an accidental rename trips CI rather than silently drifting derived fixtures downstream.None/falseerror paths onMockPkcs11Provider::sign,verify,certificate_der, andkey_labelwith unknownKeyHandlevalues (below the 1-based range and above the populated range).KeyHandleCopy/Clonesemantics: equal-comparing distinct values, usable asHashMapkeys (insert via copy collides), and de-duplicated byHashSet.SlotTokenInfothroughClone,Debug, and equality; verify mutating the clone does not affect the original and thatDebugnames every field.next_sign_countpinning the+1semantic across five successive calls.New tests use
uselesskey_test_support::{TestResult, require_ok, require_some}per the no-panic-family policy; addeduselesskey-test-supportas a dev-dependency.Test plan
cargo test -p uselesskey-pkcs11-mock(20 passed, 0 failed)cargo clippy -p uselesskey-pkcs11-mock --all-targets -- -D warningscargo fmt -p uselesskey-pkcs11-mockhttps://claude.ai/code/session_TODO
Co-authored-by: Claude noreply@anthropic.com
Generated by Claude Code