am 04b59972: am 67de2593: Merge "Add a test for getdelim(3) on a directory."

* commit '04b59972814b8d9c93b0fb72cbcaeeaa761894cd':
  Add a test for getdelim(3) on a directory.
This commit is contained in:
Elliott Hughes 2015-04-06 23:14:43 +00:00 committed by Android Git Automerger
commit 53296ddab0

View File

@ -151,6 +151,15 @@ TEST(stdio, getdelim_invalid) {
fclose(fp);
}
TEST(stdio, getdelim_directory) {
FILE* fp = fopen("/proc", "r");
ASSERT_TRUE(fp != NULL);
char* word_read;
size_t allocated_length;
ASSERT_EQ(-1, getdelim(&word_read, &allocated_length, ' ', fp));
fclose(fp);
}
TEST(stdio, getline) {
FILE* fp = tmpfile();
ASSERT_TRUE(fp != NULL);