summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak2009-02-18 15:43:34 +0100
committerKarel Zak2009-02-18 15:43:34 +0100
commit33bbc9593708f33815ce666d9eab43d5381e30cd (patch)
tree2b671fc55effd43ad242aeab48e661e319daac52
parentpo: update list of .c files (diff)
downloadkernel-qcow2-util-linux-33bbc9593708f33815ce666d9eab43d5381e30cd.tar.gz
kernel-qcow2-util-linux-33bbc9593708f33815ce666d9eab43d5381e30cd.tar.xz
kernel-qcow2-util-linux-33bbc9593708f33815ce666d9eab43d5381e30cd.zip
lib: add test_ismounted for regression test
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--lib/Makefile.am10
-rw-r--r--lib/blkdev.c2
-rw-r--r--lib/ismounted.c2
3 files changed, 8 insertions, 6 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 37205dcd6..cd4871aa3 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,13 +1,15 @@
include $(top_srcdir)/config/include-Makefile.am
-noinst_PROGRAMS = test_blkdev
+noinst_PROGRAMS = test_blkdev test_ismounted
-test_blkdev_SOURCES = $(top_srcdir)/lib/blkdev.c
+test_blkdev_SOURCES = blkdev.c
+test_ismounted_SOURCES = ismounted.c
if LINUX
-test_blkdev_SOURCES += $(top_srcdir)/lib/linux_version.c
+test_blkdev_SOURCES += linux_version.c
endif
-test_blkdev_CFLAGS = -DMAIN_TEST_BLKDEV
+test_blkdev_CFLAGS = -DTEST_PROGRAM
+test_ismounted_CFLAGS = -DTEST_PROGRAM
diff --git a/lib/blkdev.c b/lib/blkdev.c
index 79a366ca9..7c6c7bab4 100644
--- a/lib/blkdev.c
+++ b/lib/blkdev.c
@@ -107,7 +107,7 @@ blkdev_get_sector_size(int fd, int *sector_size)
}
-#ifdef MAIN_TEST_BLKDEV
+#ifdef TEST_PROGRAM
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
diff --git a/lib/ismounted.c b/lib/ismounted.c
index 4c164a954..79a1df6a1 100644
--- a/lib/ismounted.c
+++ b/lib/ismounted.c
@@ -185,7 +185,7 @@ int is_mounted(const char *file)
return mount_flags;
}
-#ifdef DEBUG
+#ifdef TEST_PROGRAM
int main(int argc, char **argv)
{
if (argc < 2) {