Lines Matching refs:fp
26 FILE* fp = tmpfile();
27 ASSERT_TRUE(fp != NULL);
29 int fd = fileno(fp);
37 rc = fprintf(fp, "hello\n");
40 rewind(fp);
43 char* s = fgets(buf, sizeof(buf), fp);
47 fclose(fp);
51 FILE* fp = tmpfile();
52 ASSERT_TRUE(fp != NULL);
55 int rc = fprintf(fp, "%s", line_written);
58 rewind(fp);
65 ASSERT_FALSE(feof(fp));
66 ASSERT_EQ(getdelim(&word_read, &allocated_length, ' ', fp), static_cast<int>(strlen(expected[i])));
71 ASSERT_TRUE(feof(fp));
72 clearerr(fp);
77 ASSERT_EQ(getdelim(&word_read, &allocated_length, ' ', fp), -1);
79 ASSERT_TRUE(feof(fp));
82 fclose(fp);
86 FILE* fp = tmpfile();
93 ASSERT_EQ(getdelim(NULL, &buffer_length, ' ', fp), -1);
98 ASSERT_EQ(getdelim(&buffer, NULL, ' ', fp), -1);
102 fclose(fp);
104 ASSERT_EQ(getdelim(&buffer, &buffer_length, ' ', fp), -1);
109 FILE* fp = tmpfile();
110 ASSERT_TRUE(fp != NULL);
116 int rc = fprintf(fp, "%s", line_written);
120 rewind(fp);
127 while ((read_char_count = getline(&line_read, &allocated_length, fp)) != -1) {
136 ASSERT_TRUE(feof(fp));
137 clearerr(fp);
142 ASSERT_EQ(getline(&line_read, &allocated_length, fp), -1);
144 ASSERT_TRUE(feof(fp));
147 fclose(fp);
151 FILE* fp = tmpfile();
158 ASSERT_EQ(getline(NULL, &buffer_length, fp), -1);
163 ASSERT_EQ(getline(&buffer, NULL, fp), -1);
167 fclose(fp);
169 ASSERT_EQ(getline(&buffer, &buffer_length, fp), -1);
186 FILE* fp = popen("cat /proc/version", "r");
187 ASSERT_TRUE(fp != NULL);
190 char* s = fgets(buf, sizeof(buf), fp);
194 ASSERT_EQ(0, pclose(fp));
198 FILE* fp = fopen("/proc/version", "r");
199 ASSERT_TRUE(fp != NULL);
200 ASSERT_EQ('L', getc(fp));
201 ASSERT_EQ('i', getc(fp));
202 ASSERT_EQ('n', getc(fp));
203 ASSERT_EQ('u', getc(fp));
204 ASSERT_EQ('x', getc(fp));
205 fclose(fp);
209 FILE* fp = fopen("/proc/version", "r");
210 ASSERT_TRUE(fp != NULL);
211 ASSERT_EQ(EOF, putc('x', fp));
212 fclose(fp);