2 * test-line-buffer.c: code to exercise the svn importer's input helper
11 #include "git-compat-util.h"
12 #include "vcs-svn/line_buffer.h"
14 static uint32_t strtouint32(const char *s
)
17 uintmax_t n
= strtoumax(s
, &end
, 10);
18 if (*s
== '\0' || *end
!= '\0')
19 die("invalid count: %s", s
);
23 int main(int argc
, char *argv
[])
28 usage("test-line-buffer < input.txt");
29 if (buffer_init(NULL
))
30 die_errno("open error");
31 while ((s
= buffer_read_line())) {
32 s
= buffer_read_string(strtouint32(s
));
36 if (!(s
= buffer_read_line()))
38 buffer_copy_bytes(strtouint32(s
) + 1);