TESTSTR
#define TESTSZ sizeof(TESTSTR)
ATF_REQUIRE_EQ(rump_sys_write(fd, TESTSTR, TESTSZ), TESTSZ);
ATF_REQUIRE_STREQ(buf, TESTSTR);
TESTSTR("The quick brown fox jumps\0over the lazy dog"),
TESTSTR("The quick brown fox jumps \0ver the lazy dog"),
TESTSTR("The quick brown fox jumps o\0er the lazy dog"),
TESTSTR("The quick brown fox jumps ov\0r the lazy dog"),
TESTSTR("The quick brown fox jumps ove\0 the lazy dog"),
TESTSTR("The quick brown fox jumps over\0the lazy dog"),
TESTSTR("The quick brown fox jumps over \0he lazy dog"),
TESTSTR("The quick brown fox jumps over t\0e lazy dog"),
TESTSTR("The quick brown fox jumps over th\0 lazy dog"),
TESTSTR("The quick brown fox jumps over the\0lazy dog"),
TESTSTR("The quick brown fox jumps over the \0azy dog"),
TESTSTR("The quick brown fox jumps over the l\0zy dog"),
TESTSTR("The quick brown fox jumps over the la\0y dog"),
TESTSTR("The quick brown fox jumps over the laz\0 dog"),
TESTSTR("The quick brown fox jumps over the lazy\0dog"),
TESTSTR("The quick brown fox jumps over the lazy \0og"),
TESTSTR("The quick brown fox jumps over the lazy d\0g"),
TESTSTR("The quick brown fox jumps over the lazy do\0"),
TESTSTR("The quick brown fox jumps over the lazy dog"),
TESTSTR("\0he quick brown fox jumps over the lazy dog"),
TESTSTR("T\0e quick brown fox jumps over the lazy dog"),
TESTSTR("Th\0 quick brown fox jumps over the lazy dog"),
TESTSTR("The\0quick brown fox jumps over the lazy dog"),
TESTSTR("The \0uick brown fox jumps over the lazy dog"),
TESTSTR("The q\0ick brown fox jumps over the lazy dog"),
TESTSTR("The qu\0ck brown fox jumps over the lazy dog"),
TESTSTR("The qui\0k brown fox jumps over the lazy dog"),
TESTSTR("The quic\0 brown fox jumps over the lazy dog"),
TESTSTR("The quick\0brown fox jumps over the lazy dog"),
TESTSTR("The quick \0rown fox jumps over the lazy dog"),
TESTSTR("The quick b\0own fox jumps over the lazy dog"),
TESTSTR("The quick br\0wn fox jumps over the lazy dog"),
TESTSTR("The quick bro\0n fox jumps over the lazy dog"),
TESTSTR("The quick brow\0 fox jumps over the lazy dog"),
TESTSTR("The quick brown\0fox jumps over the lazy dog"),
TESTSTR("The quick brown \0ox jumps over the lazy dog"),
TESTSTR("The quick brown f\0x jumps over the lazy dog"),
TESTSTR("The quick brown fo\0 jumps over the lazy dog"),
TESTSTR("The quick brown fox\0jumps over the lazy dog"),
TESTSTR("The quick brown fox \0umps over the lazy dog"),
TESTSTR("The quick brown fox j\0mps over the lazy dog"),
TESTSTR("The quick brown fox ju\0ps over the lazy dog"),
TESTSTR("The quick brown fox jum\0s over the lazy dog"),
TESTSTR("The quick brown fox jump\0 over the lazy dog"),
if (strcmp(TESTSTR, buf) != 0)
if (rump_sys_write(pipetti[1], TESTSTR, TESTSLEN) != TESTSLEN)
#define TESTSLEN (sizeof(TESTSTR)-1)
char buf[sizeof(TESTSTR)+1];
ATF_REQUIRE_EQ(thefun(TESTSTR, buf, sizeof(buf), &len), 0);
ATF_REQUIRE_EQ(len, sizeof(TESTSTR));
ATF_REQUIRE_STREQ(TESTSTR, buf);
ATF_REQUIRE_EQ(thefun(TESTSTR, buf, sizeof(buf)-1, &len), 0);
ATF_REQUIRE_EQ(len, sizeof(TESTSTR));
ATF_REQUIRE_STREQ(TESTSTR, buf);
ATF_REQUIRE_EQ(thefun(TESTSTR, buf, sizeof(buf)-2, NULL), ENAMETOOLONG);