| 83 | } |
| 84 | |
| 85 | static int test_stdin_pipe_feed(int hook_stdin_fd, void *cb UNUSED, void *task_cb) |
| 86 | { |
| 87 | int *lines_remaining = task_cb; |
| 88 | |
| 89 | if (*lines_remaining) { |
| 90 | struct strbuf buf = STRBUF_INIT; |
| 91 | strbuf_addf(&buf, "sample stdin %d\n", --(*lines_remaining)); |
| 92 | if (write_in_full(hook_stdin_fd, buf.buf, buf.len) < 0) { |
| 93 | if (errno == EPIPE) { |
| 94 | /* child closed stdin, nothing more to do */ |
| 95 | strbuf_release(&buf); |
| 96 | return 1; |
| 97 | } |
| 98 | die_errno("write"); |
| 99 | } |
| 100 | strbuf_release(&buf); |
| 101 | } |
| 102 | |
| 103 | return !(*lines_remaining); |
| 104 | } |
| 105 | |
| 106 | struct testsuite { |
| 107 | struct string_list tests, failed; |
nothing calls this directly
no test coverage detected