pcloudcc-lneely/tests/unit-tests
Levi Neely 67c99c5e06 Refactor test_ptask_free to link production code via --wrap
Extract psync_task_free + psync_task_destroy (and their static helpers
psync_task_dec_refcnt, psync_task_entry) from ptask.c into a new
separately-compilable unit pclsync/ptask_free.c. Add
pclsync/ptask_free_internal.h to expose the internal struct layout
(struct psync_task_manager_t_ / struct psync_task_t_) for test use
without pulling in ptask.c's heavyweight transitive dependencies.

Rewrite tests/unit-tests/test_ptask_free.c to:
- Include ptask_free_internal.h instead of duplicating structs inline
- Call the real psync_task_free() rather than a local replica
- Intercept pthread_mutex_lock/unlock and pmem_free via --wrap linker
  flags to observe lock discipline and detect destroy invocations

Update the Makefile test_ptask_free target to link pclsync/ptask_free.c
and pass the required --wrap flags. Production build unchanged: ptask_free.o
is picked up automatically by the existing wildcard COBJ rule.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10 19:32:05 +01:00
..
test_pdbg_path.c Add GitHub Actions CI workflow for unit tests (#379) 2026-03-10 17:48:42 +01:00
test_pfs_lock_ordering.c Fix pcl-zqv.5.7: eliminate deadlock in pfs_get_both_locks (#339) 2026-03-03 19:33:56 +01:00
test_prun.c Add GitHub Actions CI workflow for unit tests (#379) 2026-03-10 17:48:42 +01:00
test_ptask_free.c Refactor test_ptask_free to link production code via --wrap 2026-03-10 19:32:05 +01:00
test_ptools_errptr.c Fix pcl-dls: errPtr memory leak between ptools_backend_call() calls in ptools_set_backend_file_dates() (#358) 2026-03-07 19:01:17 +01:00
test_ptools_params.c Fix pcl-a1j: buffer overflow in ptools_create_backend_event() via unchecked sprintf and strcat (#355) 2026-03-07 18:35:43 +01:00
test_read_response.cpp Add GitHub Actions CI workflow for unit tests (#379) 2026-03-10 17:48:42 +01:00