| 2860 | } unwatch_snapshot_ctx_t; |
| 2861 | |
| 2862 | static int unwatch_snapshot_callback(const char *name, const char *path, void *ud) { |
| 2863 | (void)name; |
| 2864 | (void)path; |
| 2865 | unwatch_snapshot_ctx_t *ctx = ud; |
| 2866 | ctx->calls++; |
| 2867 | if (ctx->calls == 1) { |
| 2868 | /* Both states are already present in poll_once's pointer snapshot. |
| 2869 | * Removing them must invalidate the not-yet-admitted callback. */ |
| 2870 | cbm_watcher_unwatch(ctx->watcher, ctx->first_project); |
| 2871 | cbm_watcher_unwatch(ctx->watcher, ctx->second_project); |
| 2872 | } |
| 2873 | return 0; |
| 2874 | } |
| 2875 | |
| 2876 | TEST(watcher_unwatch_invalidates_remaining_poll_snapshot) { |
| 2877 | char first[256]; |
nothing calls this directly
no test coverage detected