| 22 | } |
| 23 | |
| 24 | bool cbm_doclink_test_fail_alloc(int kind) { |
| 25 | if (kind < 0 || kind >= CBM_DOCLINK_ALLOC_KINDS) { |
| 26 | return false; |
| 27 | } |
| 28 | int n = atomic_load(&doc_alloc_fail_after[kind]); |
| 29 | while (n > 0) { |
| 30 | if (atomic_compare_exchange_weak(&doc_alloc_fail_after[kind], &n, n - 1)) { |
| 31 | return n == 1; |
| 32 | } |
| 33 | } |
| 34 | return false; |
| 35 | } |
| 36 | |
| 37 | void cbm_doclink_test_reset_alloc(void) { |
| 38 | for (int i = 0; i < CBM_DOCLINK_ALLOC_KINDS; i++) { |
no outgoing calls
no test coverage detected