aboutsummaryrefslogtreecommitdiff
path: root/src/tests/test-error-helpers.c
AgeCommit message (Collapse)Author
2023-10-26modem-helpers-qmi: register QMI error translationsAleksander Morgado
We register translations for QMI core and QMI protocol errors. These translations are a best-effort, and they are not meant to be exhaustive. The original error description is included in the translated GError, so that the details of the issue are not lost.
2023-10-26modem-helpers-mbim: register MBIM error translationsAleksander Morgado
We register translations for MBIM core, MBIM protocol and MBIM status errors. These translations are a best-effort, and they are not meant to be exhaustive. The original error description is included in the translated GError, so that the details of the issue are not lost.
2023-10-26core,error-helpers: new method to normalize GErrorsAleksander Morgado
The ModemManager API should not expose or return error types out of the error domains it supports. Default to a generic core error "Failed", while keeping the original error description.
2021-05-22api: update MMMobileEquipmentError enum valuesAleksander Morgado
Update the list of mobile equipment error codes according to v17.1.0 of 3GPP TS 27.007 (March 2021). A lot of the enum values that were prefixed with the 'GPRS_' keyword have now been flagged as deprecated, and a new enum name given to the corresponding value. The deprecated symbol names are kept in the compat support to avoid breaking API/ABI.
2021-05-22core: improve error helpersAleksander Morgado
First, simplify the logic that attempts to find the correct error code associated to an error text string. This logic is very flaky, as it relies on knowing what the modems report as text string for the different error codes, and obviously that is not always the same. Instead of supporting all error codes in this logic, we now limit them to a small subset with common error codes and hopefully common error strings. Second, in order to quickly get the error description string for a given error code, we rework the array of supported errors so that the index of the array is the error code itself. For mobile equipment errors the logic is straightforward, as they're always in the [0,255] range, but for the message errors we create an array where the index of the array is equal to the code plus 300 as they're always in the [300,500] range. By doing this, we avoid having an array with 300 NULL items before the actual values we want to support.
2020-04-08log: common logging method definition for all testers and helpersAleksander Morgado
2020-04-08error-helpers: port to use object loggingAleksander Morgado
2020-04-08log: new object logging supportAleksander Morgado
So that we can provide the specific object id in every log associated to a given object.
2020-01-31test-error-helpers: fix warnings with -Wsign-compareAleksander Morgado
test-error-helpers.c: In function ‘test_error_helpers_connection_error’: test-error-helpers.c:36:39: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘gint’ {aka ‘int’} [-Werror=sign-compare] 36 | for (i = enum_class->minimum; i <= enum_class->maximum; i++) { \ | ^~
2019-12-17core,tests: new test to make sure all error codes are supportedAleksander Morgado
Defining the new error codes in the headers is not enough, we also need to add support in the error helpers in order to create proper GErrors with the expected error codes.