mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-10-16 18:56:56 +02:00
test: Move and activate fpurge() test case from module to a dedicated file
This commit is contained in:
20
src/fpurge.c
20
src/fpurge.c
@@ -44,23 +44,3 @@ fpurge(FILE *fp)
|
||||
#else
|
||||
#error "Function fpurge() needs to be ported."
|
||||
#endif
|
||||
|
||||
#ifdef TEST
|
||||
int
|
||||
main()
|
||||
{
|
||||
static FILE fp_bad;
|
||||
FILE *fp;
|
||||
|
||||
if (fpurge(&fp_bad) == 0)
|
||||
return 1;
|
||||
|
||||
fp = fopen("/dev/zero", "r");
|
||||
if (fpurge(fp) < 0)
|
||||
return 1;
|
||||
|
||||
fclose(fp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user