summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c56c42b)
raw | patch | inline | side by side (parent: c56c42b)
author | Ton Voon <tonvoon@users.sourceforge.net> | |
Wed, 18 Oct 2006 12:05:10 +0000 (12:05 +0000) | ||
committer | Ton Voon <tonvoon@users.sourceforge.net> | |
Wed, 18 Oct 2006 12:05:10 +0000 (12:05 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1497 f882894a-f735-0410-b71e-b25c423dba1c
lib/tests/test_disk.c | patch | blob | history | |
lib/utils_disk.h | patch | blob | history |
diff --git a/lib/tests/test_disk.c b/lib/tests/test_disk.c
index 8940236b069c5b8147c916d0c0c4069d2962a7aa..e48b30aaf8415c93f94875bd2593dc2d65e8e449 100644 (file)
--- a/lib/tests/test_disk.c
+++ b/lib/tests/test_disk.c
struct mount_entry *me;
struct mount_entry **mtail = &dummy_mount_list;
- plan_tests(17);
+ plan_tests(18);
ok( np_find_name(exclude_filesystem, "/var/log") == FALSE, "/var/log not in list");
np_add_name(&exclude_filesystem, "/var/log");
np_add_parameter(&paths, "/var");
np_add_parameter(&paths, "/tmp");
np_add_parameter(&paths, "/home/tonvoon");
+ np_add_parameter(&paths, "/home");
np_set_best_match(paths, dummy_mount_list, TRUE);
for (p = paths; p; p = p->name_next) {
if (! strcmp(p->name, "/home/groups")) {
- ok( p->found == 0, "/home/groups correctly not found");
+ ok( ! p->best_match , "/home/groups correctly not found");
} else if (! strcmp(p->name, "/var")) {
- ok( p->found == 1, "/var found");
+ ok( p->best_match, "/var found");
} else if (! strcmp(p->name, "/tmp")) {
- ok( p->found == 0, "/tmp correctly not found");
+ ok(! p->best_match, "/tmp correctly not found");
} else if (! strcmp(p->name, "/home/tonvoon")) {
- ok( p->found == 0, "/home/tonvoon not found");
+ ok(! p->best_match, "/home/tonvoon not found");
+ } else if (! strcmp(p->name, "/home")) {
+ ok( p->best_match, "/home found");
}
}
diff --git a/lib/utils_disk.h b/lib/utils_disk.h
index 928fdbe5d62284054db2da77d499bc3209cbcb78..700f5d26b4b5181553e4e01a74fecc84dccb3cfb 100644 (file)
--- a/lib/utils_disk.h
+++ b/lib/utils_disk.h
struct parameter_list
{
char *name;
- int found;
thresholds *freespace_bytes;
thresholds *freespace_units;
thresholds *freespace_percent;