Skip to content

turn off error logging unless test fails (was unwrap_err() in a bunch of test cases) #612

@mcr

Description

@mcr

While looking at some issues relating to the PropertyTag changes I have proposed, I see ~70 errors from various tests.
But, only they aren't being logged as errors. I'm seeing:

running 1 test
WARNING:esys:src/tss2-esys/api/Esys_Sign.c:311:Esys_Sign_Finish() Received TPM Error 
ERROR:esys:src/tss2-esys/api/Esys_Sign.c:105:Esys_Sign() Esys Finish ErrorCode (0x000001d5) 
[2025-12-21T22:22:36Z ERROR tss_esapi::context::tpm_commands::signing_and_signature_verification] Error when signing: 0x000001D5
test context_tests::tpm_commands::signing_and_signature_verification_tests::test_sign::test_sign_large_digest ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 565 filtered out; finished in 0.04s

this test, just one that I picked, does not seem to be expecting an error based upon what I read.
Yet, it's using .unwrap_err(), which as I understand it, panics if an Ok() value is returned.
Perhaps I'm wrong here, maybe it is supposed to fail, but in that case, it's failing for the wrong reason.
Maybe the test case name should say it is a failure in the name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions