Lines Matching +full:over +full:-

3 /*-
31 #include <atf-c.h>
74 #define TESTSTR(s) { s, sizeof(s)-1 }
75 TESTSTR("\0he quick brown fox jumps over the lazy dog"),
76 TESTSTR("T\0e quick brown fox jumps over the lazy dog"),
77 TESTSTR("Th\0 quick brown fox jumps over the lazy dog"),
78 TESTSTR("The\0quick brown fox jumps over the lazy dog"),
79 TESTSTR("The \0uick brown fox jumps over the lazy dog"),
80 TESTSTR("The q\0ick brown fox jumps over the lazy dog"),
81 TESTSTR("The qu\0ck brown fox jumps over the lazy dog"),
82 TESTSTR("The qui\0k brown fox jumps over the lazy dog"),
83 TESTSTR("The quic\0 brown fox jumps over the lazy dog"),
84 TESTSTR("The quick\0brown fox jumps over the lazy dog"),
85 TESTSTR("The quick \0rown fox jumps over the lazy dog"),
86 TESTSTR("The quick b\0own fox jumps over the lazy dog"),
87 TESTSTR("The quick br\0wn fox jumps over the lazy dog"),
88 TESTSTR("The quick bro\0n fox jumps over the lazy dog"),
89 TESTSTR("The quick brow\0 fox jumps over the lazy dog"),
90 TESTSTR("The quick brown\0fox jumps over the lazy dog"),
91 TESTSTR("The quick brown \0ox jumps over the lazy dog"),
92 TESTSTR("The quick brown f\0x jumps over the lazy dog"),
93 TESTSTR("The quick brown fo\0 jumps over the lazy dog"),
94 TESTSTR("The quick brown fox\0jumps over the lazy dog"),
95 TESTSTR("The quick brown fox \0umps over the lazy dog"),
96 TESTSTR("The quick brown fox j\0mps over the lazy dog"),
97 TESTSTR("The quick brown fox ju\0ps over the lazy dog"),
98 TESTSTR("The quick brown fox jum\0s over the lazy dog"),
99 TESTSTR("The quick brown fox jump\0 over the lazy dog"),
100 TESTSTR("The quick brown fox jumps\0over the lazy dog"),
105 TESTSTR("The quick brown fox jumps over\0the lazy dog"),
106 TESTSTR("The quick brown fox jumps over \0he lazy dog"),
107 TESTSTR("The quick brown fox jumps over t\0e lazy dog"),
108 TESTSTR("The quick brown fox jumps over th\0 lazy dog"),
109 TESTSTR("The quick brown fox jumps over the\0lazy dog"),
110 TESTSTR("The quick brown fox jumps over the \0azy dog"),
111 TESTSTR("The quick brown fox jumps over the l\0zy dog"),
112 TESTSTR("The quick brown fox jumps over the la\0y dog"),
113 TESTSTR("The quick brown fox jumps over the laz\0 dog"),
114 TESTSTR("The quick brown fox jumps over the lazy\0dog"),
115 TESTSTR("The quick brown fox jumps over the lazy \0og"),
116 TESTSTR("The quick brown fox jumps over the lazy d\0g"),
117 TESTSTR("The quick brown fox jumps over the lazy do\0"),
118 TESTSTR("The quick brown fox jumps over the lazy dog"),
402 * test09 - test14:
420 for (t = &testcases[0]; t->s != NULL; ++t) { in ATF_TC_BODY()
423 memcpy(&buf[0], t->s, t->n); in ATF_TC_BODY()
424 fp = fmemopen(&buf[0], t->n, *p); in ATF_TC_BODY()
435 for (i = (off_t)1; i <= (off_t)t->n; ++i) { in ATF_TC_BODY()
440 ATF_CHECK(fseeko(fp, t->n + 1, SEEK_SET) == -1); in ATF_TC_BODY()
441 ATF_CHECK(ftello(fp) == t->n); in ATF_TC_BODY()
444 ATF_CHECK(fseeko(fp, (off_t)-1, SEEK_SET) == -1); in ATF_TC_BODY()
445 ATF_CHECK(ftello(fp) == t->n); in ATF_TC_BODY()
471 for (t = &testcases[0]; t->s != NULL; ++t) { in ATF_TC_BODY()
474 memcpy(&buf[0], t->s, t->n); in ATF_TC_BODY()
475 fp = fmemopen(&buf[0], t->n, *p); in ATF_TC_BODY()
488 ATF_CHECK(fseeko(fp, (off_t)-1, SEEK_CUR) == -1); in ATF_TC_BODY()
492 for (i = 0; i < (off_t)t->n; ++i) { in ATF_TC_BODY()
498 ATF_CHECK(fseeko(fp, (off_t)1, SEEK_CUR) == -1); in ATF_TC_BODY()
499 ATF_CHECK(ftello(fp) == (off_t)t->n); in ATF_TC_BODY()
520 for (t = &testcases[0]; t->s != NULL; ++t) { in ATF_TC_BODY()
521 len = (off_t)strnlen(t->s, t->n); in ATF_TC_BODY()
522 rest = (off_t)t->n - len; in ATF_TC_BODY()
525 memcpy(&buf[0], t->s, t->n); in ATF_TC_BODY()
526 fp = fmemopen(&buf[0], t->n, *p); in ATF_TC_BODY()
532 if (i < (off_t)t->n) { in ATF_TC_BODY()
545 ATF_CHECK(fseeko(fp, (off_t)1, SEEK_CUR) == -1); in ATF_TC_BODY()
546 ATF_CHECK(ftello(fp) == (off_t)t->n); in ATF_TC_BODY()
549 for (i = (off_t)1; i <= (off_t)t->n; ++i) { in ATF_TC_BODY()
550 ATF_CHECK(fseeko(fp, (off_t)-1, SEEK_CUR) == 0); in ATF_TC_BODY()
551 ATF_CHECK(ftello(fp) == (off_t)t->n - i); in ATF_TC_BODY()
555 ATF_CHECK(fseeko(fp, (off_t)-1, SEEK_CUR) == -1); in ATF_TC_BODY()
581 for (t = &testcases[0]; t->s != NULL; ++t) { in ATF_TC_BODY()
582 len = (off_t)strnlen(t->s, t->n); in ATF_TC_BODY()
583 rest = t->n - len; in ATF_TC_BODY()
586 memcpy(buf, t->s, t->n); in ATF_TC_BODY()
587 fp = fmemopen(&buf[0], t->n, *p); in ATF_TC_BODY()
601 ATF_CHECK(fseeko(fp, rest + 1, SEEK_END) == -1); in ATF_TC_BODY()
605 ATF_CHECK(fseeko(fp, -(len + 1), SEEK_END) == -1); in ATF_TC_BODY()
616 ATF_CHECK(fseeko(fp, -i, SEEK_END) == 0); in ATF_TC_BODY()
617 ATF_CHECK(ftello(fp) == len - i); in ATF_TC_BODY()
642 for (t = &testcases[0]; t->s != NULL; ++t) { in ATF_TC_BODY()
645 memcpy(buf, t->s, t->n); in ATF_TC_BODY()
646 fp = fmemopen(&buf[0], t->n, *p); in ATF_TC_BODY()
660 ATF_CHECK(fseeko(fp, (off_t)t->n + 1, SEEK_END) == -1); in ATF_TC_BODY()
664 ATF_CHECK(fseeko(fp, -1, SEEK_END) == -1); in ATF_TC_BODY()
670 for (i = 1; i <= t->n; ++i) { in ATF_TC_BODY()
694 for (t = &testcases[0]; t->s != NULL; ++t) { in ATF_TC_BODY()
695 len = (off_t)strnlen(t->s, t->n); in ATF_TC_BODY()
696 rest = (off_t)t->n - len; in ATF_TC_BODY()
699 memcpy(buf, t->s, t->n); in ATF_TC_BODY()
700 fp = fmemopen(&buf[0], t->n, *p); in ATF_TC_BODY()
713 ATF_CHECK(fseeko(fp, rest + 1, SEEK_END) == -1); in ATF_TC_BODY()
717 ATF_CHECK(fseeko(fp, -(len + 1), SEEK_END) == -1); in ATF_TC_BODY()
730 ATF_CHECK(fseeko(fp, -i, SEEK_END) == 0); in ATF_TC_BODY()
731 ATF_CHECK(ftello(fp) == len - i); in ATF_TC_BODY()
747 /* test15 - 18:
766 for (t = &testcases[0]; t->s != NULL; ++t) { in ATF_TC_BODY()
769 memcpy(&buf0[0], t->s, t->n); in ATF_TC_BODY()
770 fp = fmemopen(&buf0[0], t->n, *p); in ATF_TC_BODY()
775 for (i = 0; i < t->n; ++i) { in ATF_TC_BODY()
783 ATF_CHECK(ftello(fp) == (off_t)t->n); in ATF_TC_BODY()
801 for (t = &testcases[0]; t->s != NULL; ++t) { in ATF_TC_BODY()
804 memcpy(&buf0[0], t->s, t->n); in ATF_TC_BODY()
805 buf1[t->n] = 0x1; in ATF_TC_BODY()
806 fp = fmemopen(&buf0[0], t->n, *p); in ATF_TC_BODY()
812 ATF_CHECK(fread(&buf1[0], 1, sizeof(buf1), fp) == (size_t)t->n); in ATF_TC_BODY()
814 ATF_CHECK(memcmp(&buf0[0], &buf1[0], t->n) == 0); in ATF_TC_BODY()
815 ATF_CHECK((unsigned char)buf1[t->n] == 0x1); in ATF_TC_BODY()
838 for (t = &testcases[0]; t->s != NULL; ++t) { in ATF_TC_BODY()
839 len = strnlen(t->s, t->n); in ATF_TC_BODY()
842 memcpy(&buf[0], t->s, t->n); in ATF_TC_BODY()
843 fp = fmemopen(&buf[0], t->n, *p); in ATF_TC_BODY()
849 if (i < t->n) { in ATF_TC_BODY()
851 for (i = len; i < t->n; ++i) { in ATF_TC_BODY()
859 ATF_CHECK(ftello(fp) == (off_t)t->n); in ATF_TC_BODY()
861 for (i = 0; i < t->n; ++i) { in ATF_TC_BODY()
869 ATF_CHECK(ftello(fp) == (off_t)t->n); in ATF_TC_BODY()
891 for (t = &testcases[0]; t->s != NULL; ++t) { in ATF_TC_BODY()
892 len = strnlen(t->s, t->n); in ATF_TC_BODY()
895 memcpy(&buf0[0], t->s, t->n); in ATF_TC_BODY()
896 buf1[t->n - len] = 0x1; in ATF_TC_BODY()
897 fp = fmemopen(&buf0[0], t->n, *p); in ATF_TC_BODY()
903 if (i < t->n) { in ATF_TC_BODY()
907 == t->n - len); in ATF_TC_BODY()
909 ATF_CHECK(!memcmp(&buf0[len], &buf1[0], t->n - len)); in ATF_TC_BODY()
910 ATF_CHECK((unsigned char)buf1[t->n - len] == 0x1); in ATF_TC_BODY()
912 buf1[t->n] = 0x1; in ATF_TC_BODY()
915 == (size_t)t->n); in ATF_TC_BODY()
917 ATF_CHECK(!memcmp(&buf0[0], &buf1[0], t->n)); in ATF_TC_BODY()
918 ATF_CHECK((unsigned char)buf1[t->n] == 0x1); in ATF_TC_BODY()
928 * test19 - test22:
953 for (t = &testcases[0]; t->s != NULL; ++t) { in ATF_TC_BODY()
956 memcpy(&buf[0], t->s, t->n); in ATF_TC_BODY()
957 buf[t->n] = 0x1; in ATF_TC_BODY()
958 fp = fmemopen(&buf[0], t->n + 1, *p); in ATF_TC_BODY()
964 for (i = 0; i < t->n; ++i) { in ATF_TC_BODY()
966 ATF_CHECK(fputc(t->s[i], fp) == t->s[i]); in ATF_TC_BODY()
967 ATF_CHECK(buf[i] == t->s[i]); in ATF_TC_BODY()
969 ATF_CHECK(buf[i] == t->s[i]); in ATF_TC_BODY()
977 ATF_CHECK(ftello(fp) == (off_t)t->n); in ATF_TC_BODY()
982 ATF_CHECK(ftello(fp) == (off_t)t->n + 1); in ATF_TC_BODY()
987 ATF_CHECK(ftello(fp) == (off_t)t->n + 1); in ATF_TC_BODY()
990 ATF_CHECK(memcmp(&buf[0], t->s, t->n) == 0); in ATF_TC_BODY()
991 ATF_CHECK(buf[t->n] == '\0'); in ATF_TC_BODY()
1010 for (t = &testcases[0]; t->s != NULL; ++t) { in ATF_TC_BODY()
1013 memcpy(&buf[0], t->s, t->n); in ATF_TC_BODY()
1014 buf[t->n] = 0x1; in ATF_TC_BODY()
1015 fp = fmemopen(&buf[0], t->n + 1, *p); in ATF_TC_BODY()
1018 ATF_CHECK(fwrite(t->s, 1, t->n, fp) == (size_t)t->n); in ATF_TC_BODY()
1023 ATF_CHECK(buf[t->n] == '\0'); in ATF_TC_BODY()
1027 ATF_CHECK(ftello(fp) == (off_t)t->n); in ATF_TC_BODY()
1033 ATF_CHECK(ftello(fp) == (off_t)t->n + 1); in ATF_TC_BODY()
1038 ATF_CHECK(ftello(fp) == (off_t)t->n + 1); in ATF_TC_BODY()
1041 ATF_CHECK(memcmp(&buf[0], t->s, t->n) == 0); in ATF_TC_BODY()
1042 ATF_CHECK(buf[t->n] == '\0'); in ATF_TC_BODY()
1062 for (t = &testcases[0]; t->s != NULL; ++t) { in ATF_TC_BODY()
1063 len = strnlen(t->s, t->n); in ATF_TC_BODY()
1065 memcpy(&buf[0], t->s, t->n); in ATF_TC_BODY()
1066 fp = fmemopen(&buf[0], t->n, *p); in ATF_TC_BODY()
1072 if (len < t->n) { in ATF_TC_BODY()
1073 for (i = len; i < t->n - 1; ++i) { in ATF_TC_BODY()
1075 ATF_CHECK(fputc(t->s[i - len], fp) in ATF_TC_BODY()
1076 == t->s[i - len]); in ATF_TC_BODY()
1077 ATF_CHECK(buf[i] == t->s[i - len]); in ATF_TC_BODY()
1085 ATF_CHECK(ftello(fp) == (off_t)t->n - 1); in ATF_TC_BODY()
1087 ATF_CHECK(ftello(fp) == (off_t)t->n - 1); in ATF_TC_BODY()
1090 ATF_CHECK(ftello(fp) == (off_t)t->n - 1); in ATF_TC_BODY()
1092 ATF_CHECK(ftello(fp) == (off_t)t->n); in ATF_TC_BODY()
1096 ATF_CHECK(ftello(fp) == (off_t)t->n); in ATF_TC_BODY()
1098 ATF_CHECK(ftello(fp) == (off_t)t->n); in ATF_TC_BODY()
1118 for (t0 = &testcases[0]; t0->s != NULL; ++t0) { in ATF_TC_BODY()
1119 len0 = strnlen(t0->s, t0->n); in ATF_TC_BODY()
1120 for (t1 = &testcases[0]; t1->s != NULL; ++t1) { in ATF_TC_BODY()
1121 len1 = strnlen(t1->s, t1->n); in ATF_TC_BODY()
1124 memcpy(&buf[0], t0->s, t0->n); in ATF_TC_BODY()
1125 fp = fmemopen(&buf[0], t0->n, *p); in ATF_TC_BODY()
1131 nleft = t0->n - len0; in ATF_TC_BODY()
1133 if (nleft == 0 || len1 == nleft - 1) { in ATF_TC_BODY()
1134 ATF_CHECK(fwrite(t1->s, 1, t1->n, fp) in ATF_TC_BODY()
1136 ATF_CHECK(ftell(fp) == t1->n); in ATF_TC_BODY()
1138 ATF_CHECK(fwrite(t1->s, 1, t1->n, fp) in ATF_TC_BODY()
1139 == nleft - 1); in ATF_TC_BODY()
1140 ATF_CHECK(ftell(fp) == t1->n - 1); in ATF_TC_BODY()