Commit Graph

38 Commits

Author SHA1 Message Date
e5f761662c Reformat new test files with Stroustrup style
All checks were successful
libakerror CI Build / cmake_build (push) Successful in 2m38s
Apply emacs CC-mode "stroustrup" style (c-basic-offset 4, indent-tabs-mode t)
to the test files added in the previous commit, matching the existing house
style. Whitespace only; no behavioral change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-27 16:35:32 -04:00
4daa411f3f Expand test coverage for error-handling macros and error pool
All checks were successful
libakerror CI Build / cmake_build (push) Successful in 2m42s
Add 11 CTest programs and a shared test helper covering gaps left by the
original four tests (which only exercised FAIL/CATCH/HANDLE and CLEANUP):

- err_capture.h: capturing akerr_log_method + NDEBUG-proof AKERR_CHECK so
  tests can assert on message/status/stacktrace content, not just exit codes
- err_success: clean nested return does not break/handle/leak
- err_pool_refcount: 100k raise->catch->handle cycles leak 0 pool slots
- err_handle_default / err_handle_group / err_handle_dispatch: handler routing
- err_pass / err_ignore / err_swallow: PASS, IGNORE, FINISH(e,false)
- err_break_variants: FAIL_*_BREAK and FAIL_*_RETURN
- err_errno: system errno name lookup + "Unknown Error" boundary
- err_custom_handler: override the unhandled-error hook, assert non-fatally

Register tests via a foreach loop in CMakeLists.txt. Ignore build/.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-27 16:18:17 -04:00
4fad0cec59 Add gitea workflow
All checks were successful
libakerror CI Build / cmake_build (push) Successful in 2m39s
2026-06-27 10:22:26 -04:00
5b1a6c2cc7 Remove spurious duplicate lines from the stacktrace. Only log the DETECT and FAIL points, everything else is noise. 2026-06-27 08:37:05 -04:00
675c60b5e0 Removed AKERR_HEAP, AKERR_REGISTRY, AKERR_BEHAVIOR, they belong to libakgl. Replaced AKERR_BEHAVIOR which was ambiguous with AKERR_BADEXC which is raised when a function falls to call SUCCEED_RETURN(). 2026-06-22 08:15:07 -04:00
93f5e93480 Add an error type for circular references 2026-06-02 17:12:14 -04:00
b5435041f2 VALID() wasn't resetting invalid error contexts back to NULL before atempting to ENSURE_READY() them 2026-05-24 19:41:32 -04:00
235033d633 VALID() wasn't properly handling NULL returns, leading to false positives 2026-05-24 19:14:35 -04:00
7700af06a1 Changes maximum stacktrace string values to better allow for inclusion of values up to PATH_MAX. I don't like it. The values are huge. Need a better more sensible way. 2026-05-24 09:50:21 -04:00
be2dba8416 Fix a bug in the new VALID() method, false is not true 2026-05-21 21:44:52 -04:00
03e9b8a96d Update docs, replace the missing VALID() macro to safeguard against misbehaving functions, add PASS, remove CATCH_AND_RETURN 2026-05-15 19:41:22 -04:00
768a235da4 Fix builds when in a submodule 2026-05-12 21:29:07 -04:00
4a09ca87fd Fix cmake duplicate targets 2026-05-12 16:56:49 -04:00
51b6b23b4c Make the build work from a subdirectory dependency 2026-05-12 16:44:06 -04:00
166a478e6a Add AKERR_EOF, properly call akerr_init_errno 2026-05-12 16:42:33 -04:00
0c29f5d69f Fix handling of CATCH() or FAIL() macros around functions that should return an (akerr_ErrorContext *) but return an invalid pointer (to something not in our exception array) 2026-05-06 12:36:56 -04:00
c840536e1d Fix a couple errors in the README 2026-01-12 09:26:28 -05:00
14e903a81c Import all system definitions of errno including their string representations, then layer our error definitions on top of that 2026-01-12 09:23:36 -05:00
6acae958ff Fix bug in CMake installation that prevented users from finding the headers via cmake/pkgconfig 2026-01-12 08:32:29 -05:00
cb9af93e0b README fixes, fix a bug in the header stdlib checking 2026-01-10 22:03:14 -05:00
c526bb1ba3 Cleanup the code and unified everything (except the macros) under the akerr_ namespace 2026-01-10 10:20:35 -05:00
6821752ec7 Change naming convention for the error context array to avoid confusion about whether it is dynamic or static 2026-01-10 09:50:17 -05:00
f2ce97224a Fix a possible buffer overflow when writing to the stacktrace buffer 2026-01-10 08:42:50 -05:00
3e4f0d1cda Fix a possible buffer overflow in FAIL() when writing to the stacktrace buffer 2026-01-10 08:41:06 -05:00
cf0f2bbeac Make stdlib optional. Remove dependency on SDL3. Update README. 2026-01-05 21:18:44 -05:00
8962c65914 Add cmake and pkgconfig info to the README 2025-08-03 10:13:27 -04:00
428b59c83f Fix some minor issues on the __ERROR_NAMES 2025-08-02 23:03:51 -04:00
f5654af680 Removed spurious error.h, renamed to sdlerror.h 2025-08-02 15:09:12 -04:00
0521ebaf7d Better support for user-defined error codes and messages 2025-08-02 15:07:08 -04:00
758d994adb Add explanation of ERROR_NOIGNORE to the README 2025-08-02 14:32:47 -04:00
9c1446bf71 Add explanation of ERROR_NOIGNORE to the README 2025-08-02 14:28:54 -04:00
3b9f3048ea Document stacktraces, add example builds to CMakeLists.txt 2025-07-21 08:54:26 -04:00
36eadd569f Improve README, add example tests 2025-07-21 07:25:09 -04:00
9b3835d484 Improve README, add example tests 2025-07-21 07:24:00 -04:00
a3c9d815e5 Improve README, add example tests 2025-07-21 07:19:41 -04:00
826676dca2 Move from Makefile to CMake 2025-07-20 22:02:21 -04:00
79154b2851 Add AI generated README.md 2025-07-20 21:44:17 -04:00
052f7a078a Add library 2025-07-20 21:40:14 -04:00