Lines Matching refs:fp
35 FILE* fp = fopen("/proc/version", "r"); in TEST() local
38 ASSERT_EQ(0U, __fbufsize(fp)); in TEST()
42 fgets(buf, sizeof(buf), fp); in TEST()
43 ASSERT_EQ(1024U, __fbufsize(fp)); in TEST()
45 ASSERT_EQ(0, setvbuf(fp, buf, _IOFBF, 1)); in TEST()
46 ASSERT_EQ(1U, __fbufsize(fp)); in TEST()
48 ASSERT_EQ(0, setvbuf(fp, buf, _IOFBF, 8)); in TEST()
49 ASSERT_EQ(8U, __fbufsize(fp)); in TEST()
51 fclose(fp); in TEST()
55 FILE* fp = fopen("/proc/version", "r"); in TEST() local
57 ASSERT_FALSE(__flbf(fp)); in TEST()
60 ASSERT_EQ(0, setvbuf(fp, buf, _IOLBF, sizeof(buf))); in TEST()
62 ASSERT_TRUE(__flbf(fp)); in TEST()
64 fclose(fp); in TEST()
68 FILE* fp = fopen("/dev/null", "w"); in TEST() local
69 ASSERT_EQ(0U, __fpending(fp)); in TEST()
70 ASSERT_EQ('x', fputc('x', fp)); in TEST()
71 ASSERT_EQ(1U, __fpending(fp)); in TEST()
72 ASSERT_EQ('y', fputc('y', fp)); in TEST()
73 ASSERT_EQ(2U, __fpending(fp)); in TEST()
74 fflush(fp); in TEST()
75 ASSERT_EQ(0U, __fpending(fp)); in TEST()
76 fclose(fp); in TEST()
80 FILE* fp = tmpfile(); in TEST() local
82 ASSERT_EQ('a', fputc('a', fp)); in TEST()
83 ASSERT_EQ(1U, __fpending(fp)); in TEST()
84 __fpurge(fp); in TEST()
85 ASSERT_EQ(0U, __fpending(fp)); in TEST()
87 ASSERT_EQ('b', fputc('b', fp)); in TEST()
88 ASSERT_EQ('\n', fputc('\n', fp)); in TEST()
89 ASSERT_EQ(2U, __fpending(fp)); in TEST()
91 rewind(fp); in TEST()
94 char* s = fgets(buf, sizeof(buf), fp); in TEST()
98 fclose(fp); in TEST()
102 FILE* fp = fopen("/dev/null", "w"); in TEST() local
105 ASSERT_EQ(0, setvbuf(fp, buf, _IOLBF, sizeof(buf))); in TEST()
107 ASSERT_EQ('a', fputc('a', fp)); in TEST()
108 ASSERT_EQ(1U, __fpending(fp)); in TEST()
112 ASSERT_EQ(0U, __fpending(fp)); in TEST()
114 fclose(fp); in TEST()
118 FILE* fp = fopen("/dev/null", "r"); in TEST() local
119 ASSERT_TRUE(__freadable(fp)); in TEST()
120 ASSERT_FALSE(__fwritable(fp)); in TEST()
121 fclose(fp); in TEST()
123 fp = fopen("/dev/null", "w"); in TEST()
124 ASSERT_FALSE(__freadable(fp)); in TEST()
125 ASSERT_TRUE(__fwritable(fp)); in TEST()
126 fclose(fp); in TEST()
128 fp = fopen("/dev/null", "w+"); in TEST()
129 ASSERT_TRUE(__freadable(fp)); in TEST()
130 ASSERT_TRUE(__fwritable(fp)); in TEST()
131 fclose(fp); in TEST()
135 FILE* fp = fopen("/proc/version", "r"); in TEST() local
136 ASSERT_EQ(FSETLOCKING_INTERNAL, __fsetlocking(fp, FSETLOCKING_QUERY)); in TEST()
137 ASSERT_EQ(FSETLOCKING_INTERNAL, __fsetlocking(fp, FSETLOCKING_BYCALLER)); in TEST()
138 ASSERT_EQ(FSETLOCKING_BYCALLER, __fsetlocking(fp, FSETLOCKING_QUERY)); in TEST()
139 ASSERT_EQ(FSETLOCKING_BYCALLER, __fsetlocking(fp, FSETLOCKING_INTERNAL)); in TEST()
140 ASSERT_EQ(FSETLOCKING_INTERNAL, __fsetlocking(fp, FSETLOCKING_QUERY)); in TEST()
141 fclose(fp); in TEST()