Add a test for getdelim(3) on a directory.

Apparently uClibc has a bug here. We don't, but let's keep it that way.

Bug: http://landley.net/notes.html#21-03-2015
Change-Id: If406df963db9bee47921d7a1c116ebcab08d96bf
This commit is contained in:
Elliott Hughes 2015-04-05 10:51:56 -07:00
parent ec8b3a7dde
commit 694fd2d880
1 changed files with 9 additions and 0 deletions

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);