aboutsummaryrefslogtreecommitdiff
path: root/tests/test_utils.c
Commit message (Collapse)AuthorAgeFilesLines
* free(3): If ptr is NULL, no operation is performed.free-memJoseph Hunkeler2025-03-201-4/+4
|
* tests: free allocated resourcesJoseph Hunkeler2025-02-041-0/+6
|
* Refactor ini getter and setter usage (#19)Joseph Hunkeler2024-08-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add handler for space-delimited lists * This needs attention, however. The INI writer has no way to know a list with spaces is a list; this happens in the value conversion functions. * Add type_hint member to INIData structure. At some point support with be added for all INIVAL_TYPE_* defines. Right now it's only used with arrays. * Zero out line buffer in ini_open after each iteration * Do not strip raw INI data. Let the conversion functions handle it * Add spaces to key value pairs in rendered INI output. * Add ini_getvar_TYPE() functions * These replace the functionality of static conv_TYPE() functions in delivery.c * Add support for missing types: U/CHAR, U/SHORT, STRLIST * ini_getval: expand template variables immediately before processing the output * Strip leading space to avoid issues with string comparisons against the result * ini_getval: Return copies, not the original. * This forces one to use ini_setval to replace/append values to the data array(s). It's safer this way. * fix_tox_conf(): Use ini_getval and ini_setval instead of modifying the original pointers directly * Tests: Free resources * Replace ini_getval(), ini_getval_required() and conv_*() usage * Now using ini_getval_TYPE() functions and ini_setval() * Remove unused helper functions and variables * download() returns long, not int * actions: update apt cache
* Rebrand OhMyCal (OMC) as STASIS (#7)Joseph Hunkeler2024-06-211-66/+66
|
* Unit tests (#6)Joseph Hunkeler2024-06-201-0/+479
* Initial commit of unit tests [WIP] * Address shortcomings and bugs flushed out by unit tests * Enable unit testing in CI workflow * Enable verbose ctests * Handle lack of __FILE_NAME__ define * Only podman support `run --arch` argument * Skip docker build testing if CI system cannot pull an image * Remove errant call to puts() * Identify local repo user * Fix missing xmllint * NULL terminate arrays * Fix filename assignment in is_url mode * Break loop when expected lines are exhausted * strcmp_array expects NULL terminated array. Iterating by size in this case passes NULL to strcmp leading to an invalid read * Remove debug printf statements * Disable a few warnings for tests * Workaround for ctest junit xml truncation * Update checkout@v4 * Prevent false-positive result * Return zero on error * Fix strlist_remove function * Value argument can be constant * Fix test to match changes to startswith and endswith * Add test_ini.c * Fix redaction code to accept NULL pointers in array * And let the caller specify the length of the array of strings to redact. * Redactions now occur directly on authentication strings rather than their command line arguments * Fix BUILD_TESTING_DEBUG * Adds missing -D argument