Home | History | Annotate | Download | only in testsuite

Lines Matching refs:sbuf

28 	struct scratchbuf sbuf;
33 scratchbuf_init(&sbuf, buf, sizeof(buf));
34 assert_return(scratchbuf_alloc(&sbuf, strlen(smallstr) + 1) == 0, EXIT_FAILURE);
35 assert_return(sbuf.need_free == false, EXIT_FAILURE);
36 scratchbuf_release(&sbuf);
38 scratchbuf_init(&sbuf, buf2, sizeof(buf2));
39 assert_return(scratchbuf_alloc(&sbuf, strlen(smallstr) + 1) == 0, EXIT_FAILURE);
40 assert_return(sbuf.need_free == false, EXIT_FAILURE);
41 scratchbuf_release(&sbuf);
43 memcpy(scratchbuf_str(&sbuf), smallstr, strlen(smallstr) + 1);
44 assert_return(strcmp(scratchbuf_str(&sbuf), smallstr) == 0, EXIT_FAILURE);
54 struct scratchbuf sbuf;
60 scratchbuf_init(&sbuf, buf, sizeof(buf));
63 assert_return(scratchbuf_alloc(&sbuf, strlen(smallstr) + 1) == 0, EXIT_FAILURE);
64 assert_return(sbuf.need_free == false, EXIT_FAILURE);
65 memcpy(scratchbuf_str(&sbuf), smallstr, strlen(smallstr) + 1);
68 assert_return(scratchbuf_alloc(&sbuf, strlen(largestr) + 1) == 0, EXIT_FAILURE);
69 assert_return(sbuf.need_free == true, EXIT_FAILURE);
70 assert_return(sbuf.size == strlen(largestr) + 1, EXIT_FAILURE);
71 assert_return(strcmp(scratchbuf_str(&sbuf), smallstr) == 0, EXIT_FAILURE);
72 memcpy(scratchbuf_str(&sbuf), largestr, strlen(largestr) + 1);
73 assert_return(strcmp(scratchbuf_str(&sbuf), largestr) == 0, EXIT_FAILURE);
76 assert_return(scratchbuf_alloc(&sbuf, strlen(largestr2) + 1) == 0, EXIT_FAILURE);
77 assert_return(sbuf.need_free == true, EXIT_FAILURE);
78 assert_return(sbuf.size == strlen(largestr2) + 1, EXIT_FAILURE);
79 memcpy(scratchbuf_str(&sbuf), largestr2, strlen(largestr2) + 1);
80 assert_return(strcmp(scratchbuf_str(&sbuf), largestr2) == 0, EXIT_FAILURE);
82 scratchbuf_release(&sbuf);