File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99- [O] Other
1010```
1111
12+ ### v0.6.4 ()
13+
14+ - [ B] utils: fix ` cdada_strerr() ` bounds handling for invalid and negative error codes
15+ - [ B] utils: add missing human-readable message for ` CDADA_E_FULL `
16+ - [ O] tests: add coverage for ` cdada_strerr() ` valid, boundary and high invalid values
17+
1218### v0.6.3 (28th January 2026)
1319
1420- [ O] tests/CI: fixed compilation with GCC 16 (thanks A. Stieger). Added CI coverage for GCC 15.
Original file line number Diff line number Diff line change @@ -10,11 +10,12 @@ static const char* cdada_err_str[CDADA_E_COUNT] = {
1010 "Out of memory" ,
1111 "Feature unsupported" ,
1212 "Empty" ,
13- "Incomplete"
13+ "Incomplete" ,
14+ "Full"
1415};
1516
1617const char * cdada_strerr (int err ){
17- return err >= CDADA_E_COUNT ? "Invalid code" : cdada_err_str [err ];
18+ return ( err < 0 || err >= CDADA_E_COUNT ) ? "Invalid code" : cdada_err_str [err ];
1819}
1920
2021const char * cdada_get_ver (){
Original file line number Diff line number Diff line change @@ -47,6 +47,12 @@ int main(int args, char** argv){
4747 rv = cdada_stack_destroy (stack );
4848 TEST_ASSERT (rv == CDADA_SUCCESS );
4949
50+ TEST_ASSERT (strcmp (cdada_strerr (CDADA_SUCCESS ), "Success" ) == 0 );
51+ TEST_ASSERT (strcmp (cdada_strerr (CDADA_E_FULL ), "Full" ) == 0 );
52+ TEST_ASSERT (strcmp (cdada_strerr (-1 ), "Invalid code" ) == 0 );
53+ TEST_ASSERT (strcmp (cdada_strerr (CDADA_E_COUNT ), "Invalid code" ) == 0 );
54+ TEST_ASSERT (strcmp (cdada_strerr (CDADA_E_COUNT + 1000 ), "Invalid code" ) == 0 );
55+
5056 //Add your test here, and return a code appropriately...
5157 return rv == 0 ? EXIT_SUCCESS : EXIT_FAILURE ;
5258}
You can’t perform that action at this time.
0 commit comments