rnpgp / rnp

RNP: high performance C++ OpenPGP library used by Mozilla Thunderbird
https://www.rnpgp.org
Other
194 stars 55 forks source link

Missing result codes in rnp_result_to_string() #1878

Closed antonsviridenko closed 2 years ago

antonsviridenko commented 2 years ago

Description

FFI function rnp_result_to_string() does not return string results for all defined status/error codes. At this moment 31 error/status/result codes are defined in https://github.com/rnpgp/rnp/blob/master/include/rnp/rnp_err.h#L32 but only 26 of them are handled by rnp_result_to_string()

Expected Behavior

All defined codes should have corresponding string value in rnp_result_to_string()

Actual Behavior

Codes

RNP_ERROR_RNG
RNP_ERROR_SIGNATURE_EXPIRED
RNP_ERROR_SIGNATURE_UNKNOWN
RNP_ERROR_VERIFICATION_FAILED

are missing.

antonsviridenko commented 2 years ago

and also RNP_ERROR_SIGNING_FAILED

antonsviridenko commented 2 years ago

There was no test for rnp_result_to_string(). Any ideas how to check all enum values are covered without manually typing all of them? :)