summaryrefslogtreecommitdiffstats
path: root/old-tests
diff options
context:
space:
mode:
authorJoe Thornber <thornber@redhat.com>2001-10-02 13:44:44 +0000
committerJoe Thornber <thornber@redhat.com>2001-10-02 13:44:44 +0000
commitfa2c452669d63e4b209047f38a8d8ba3f0d8ad13 (patch)
treecd29640bbcd15a7ac8ee7dda5805918cae464456 /old-tests
parente7ae85737be071a27b798450b18267a9b3354798 (diff)
downloadlvm2-fa2c452669d63e4b209047f38a8d8ba3f0d8ad13.tar.gz
lvm2-fa2c452669d63e4b209047f38a8d8ba3f0d8ad13.tar.xz
lvm2-fa2c452669d63e4b209047f38a8d8ba3f0d8ad13.zip
o test program for the device cache
Diffstat (limited to 'old-tests')
-rw-r--r--old-tests/dev-mgr/dev_cache_t.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/old-tests/dev-mgr/dev_cache_t.c b/old-tests/dev-mgr/dev_cache_t.c
new file mode 100644
index 00000000..f08839ca
--- /dev/null
+++ b/old-tests/dev-mgr/dev_cache_t.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2001 Sistina Software (UK) Limited
+ *
+ * This file is released under the GPL.
+ */
+
+#include "dev-cache.h"
+#include "log.h"
+
+#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+ int i;
+ struct device *dev;
+ struct dev_iter *iter;
+
+ init_log();
+ if (!dev_cache_init()) {
+ log_error("couldn't initialise dev_cache_init failed\n");
+ exit(1);
+ }
+
+ for (i = 1; i < argc; i++) {
+ if (!dev_cache_add_dir(argv[i])) {
+ log_error("couldn't add '%s' to dev_cache\n");
+ exit(1);
+ }
+ }
+
+ if (!(iter = dev_iter_create(NULL))) {
+ log_error("couldn't create iterator\n");
+ exit(1);
+ }
+
+ while ((dev = dev_iter_next(iter)))
+ printf("%s\n", dev->name);
+
+ dev_iter_destroy(iter):
+ dev_cache_exit();
+
+ dump_memory();
+ fin_log();
+ return 0;
+}