From 444518fedfcd3200d78744365373cebbbb9016fd Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 8 May 1998 23:54:11 +0000 Subject: Update. 1998-05-08 23:49 Ulrich Drepper * misc/Makefile (tests): Add tst-mntent. * misc/tst-mntent.c: New file. --- misc/Makefile | 2 +- misc/tst-mntent.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 misc/tst-mntent.c (limited to 'misc') diff --git a/misc/Makefile b/misc/Makefile index c8b2302c99..52bf339309 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -61,7 +61,7 @@ aux := init-misc install-lib := libbsd-compat.a libg.a gpl2lgpl := error.c error.h -tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt +tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent include ../Rules diff --git a/misc/tst-mntent.c b/misc/tst-mntent.c new file mode 100644 index 0000000000..cd67c98fe6 --- /dev/null +++ b/misc/tst-mntent.c @@ -0,0 +1,24 @@ +/* Test case by Horst von Brand . */ +#include +#include + +int +main (int argc, char *argv[]) +{ + int result = 0; + struct mntent mef = + { + "/dev/hda1", "/", "ext2", "defaults", 1, 1 + }; + struct mntent *mnt = &mef; + + if (hasmntopt (mnt, "defaults")) + printf("Found!\n"); + else + { + printf("Didn't find it\n"); + result = 1; + } + + return result; +} -- cgit 1.4.1