diff options
| author | Jan Wagner <waja@cyconet.org> | 2023-10-17 13:39:37 +0200 |
|---|---|---|
| committer | Jan Wagner <waja@cyconet.org> | 2023-10-17 13:39:37 +0200 |
| commit | 2a047014385022c8dc06dad4da0428db14898689 (patch) | |
| tree | 00abea46325decf0c72870ee8f9ec1472e8e5344 /lib/tests/test_disk.c | |
| parent | f39211c26408af582121f519d89c8abf70e6d437 (diff) | |
| parent | e23a75d954311b3be429a9020e4d317b89615ee7 (diff) | |
| download | monitoring-plugins-2a04701.tar.gz | |
Merge branch 'master' of github.com:monitoring-plugins/monitoring-plugins
Diffstat (limited to 'lib/tests/test_disk.c')
| -rw-r--r-- | lib/tests/test_disk.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/lib/tests/test_disk.c b/lib/tests/test_disk.c index 9bd68c7a..e283fe2e 100644 --- a/lib/tests/test_disk.c +++ b/lib/tests/test_disk.c | |||
| @@ -1,19 +1,19 @@ | |||
| 1 | /***************************************************************************** | 1 | /***************************************************************************** |
| 2 | * | 2 | * |
| 3 | * This program is free software: you can redistribute it and/or modify | 3 | * This program is free software: you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by | 4 | * it under the terms of the GNU General Public License as published by |
| 5 | * the Free Software Foundation, either version 3 of the License, or | 5 | * the Free Software Foundation, either version 3 of the License, or |
| 6 | * (at your option) any later version. | 6 | * (at your option) any later version. |
| 7 | * | 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. | 11 | * GNU General Public License for more details. |
| 12 | * | 12 | * |
| 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | * | 15 | * |
| 16 | * | 16 | * |
| 17 | *****************************************************************************/ | 17 | *****************************************************************************/ |
| 18 | 18 | ||
| 19 | #include "common.h" | 19 | #include "common.h" |
| @@ -44,19 +44,19 @@ main (int argc, char **argv) | |||
| 44 | 44 | ||
| 45 | plan_tests(33); | 45 | plan_tests(33); |
| 46 | 46 | ||
| 47 | ok( np_find_name(exclude_filesystem, "/var/log") == FALSE, "/var/log not in list"); | 47 | ok( np_find_name(exclude_filesystem, "/var/log") == false, "/var/log not in list"); |
| 48 | np_add_name(&exclude_filesystem, "/var/log"); | 48 | np_add_name(&exclude_filesystem, "/var/log"); |
| 49 | ok( np_find_name(exclude_filesystem, "/var/log") == TRUE, "is in list now"); | 49 | ok( np_find_name(exclude_filesystem, "/var/log") == true, "is in list now"); |
| 50 | ok( np_find_name(exclude_filesystem, "/home") == FALSE, "/home not in list"); | 50 | ok( np_find_name(exclude_filesystem, "/home") == false, "/home not in list"); |
| 51 | np_add_name(&exclude_filesystem, "/home"); | 51 | np_add_name(&exclude_filesystem, "/home"); |
| 52 | ok( np_find_name(exclude_filesystem, "/home") == TRUE, "is in list now"); | 52 | ok( np_find_name(exclude_filesystem, "/home") == true, "is in list now"); |
| 53 | ok( np_find_name(exclude_filesystem, "/var/log") == TRUE, "/var/log still in list"); | 53 | ok( np_find_name(exclude_filesystem, "/var/log") == true, "/var/log still in list"); |
| 54 | 54 | ||
| 55 | ok( np_find_name(exclude_fstype, "iso9660") == FALSE, "iso9660 not in list"); | 55 | ok( np_find_name(exclude_fstype, "iso9660") == false, "iso9660 not in list"); |
| 56 | np_add_name(&exclude_fstype, "iso9660"); | 56 | np_add_name(&exclude_fstype, "iso9660"); |
| 57 | ok( np_find_name(exclude_fstype, "iso9660") == TRUE, "is in list now"); | 57 | ok( np_find_name(exclude_fstype, "iso9660") == true, "is in list now"); |
| 58 | 58 | ||
| 59 | ok( np_find_name(exclude_filesystem, "iso9660") == FALSE, "Make sure no clashing in variables"); | 59 | ok( np_find_name(exclude_filesystem, "iso9660") == false, "Make sure no clashing in variables"); |
| 60 | 60 | ||
| 61 | /* | 61 | /* |
| 62 | for (temp_name = exclude_filesystem; temp_name; temp_name = temp_name->next) { | 62 | for (temp_name = exclude_filesystem; temp_name; temp_name = temp_name->next) { |
| @@ -120,7 +120,7 @@ main (int argc, char **argv) | |||
| 120 | np_add_parameter(&paths, "/home/tonvoon"); | 120 | np_add_parameter(&paths, "/home/tonvoon"); |
| 121 | np_add_parameter(&paths, "/dev/c2t0d0s0"); | 121 | np_add_parameter(&paths, "/dev/c2t0d0s0"); |
| 122 | 122 | ||
| 123 | np_set_best_match(paths, dummy_mount_list, FALSE); | 123 | np_set_best_match(paths, dummy_mount_list, false); |
| 124 | for (p = paths; p; p = p->name_next) { | 124 | for (p = paths; p; p = p->name_next) { |
| 125 | struct mount_entry *temp_me; | 125 | struct mount_entry *temp_me; |
| 126 | temp_me = p->best_match; | 126 | temp_me = p->best_match; |
| @@ -144,7 +144,7 @@ main (int argc, char **argv) | |||
| 144 | np_add_parameter(&paths, "/home/tonvoon"); | 144 | np_add_parameter(&paths, "/home/tonvoon"); |
| 145 | np_add_parameter(&paths, "/home"); | 145 | np_add_parameter(&paths, "/home"); |
| 146 | 146 | ||
| 147 | np_set_best_match(paths, dummy_mount_list, TRUE); | 147 | np_set_best_match(paths, dummy_mount_list, true); |
| 148 | for (p = paths; p; p = p->name_next) { | 148 | for (p = paths; p; p = p->name_next) { |
| 149 | if (! strcmp(p->name, "/home/groups")) { | 149 | if (! strcmp(p->name, "/home/groups")) { |
| 150 | ok( ! p->best_match , "/home/groups correctly not found"); | 150 | ok( ! p->best_match , "/home/groups correctly not found"); |
| @@ -167,7 +167,7 @@ main (int argc, char **argv) | |||
| 167 | } | 167 | } |
| 168 | ok(found == 0, "first element successfully deleted"); | 168 | ok(found == 0, "first element successfully deleted"); |
| 169 | found = 0; | 169 | found = 0; |
| 170 | 170 | ||
| 171 | p=paths; | 171 | p=paths; |
| 172 | while (p) { | 172 | while (p) { |
| 173 | if (! strcmp(p->name, "/tmp")) | 173 | if (! strcmp(p->name, "/tmp")) |
| @@ -203,9 +203,9 @@ main (int argc, char **argv) | |||
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | 205 | ||
| 206 | void | 206 | void |
| 207 | np_test_mount_entry_regex (struct mount_entry *dummy_mount_list, char *regstr, int cflags, int expect, char *desc) | 207 | np_test_mount_entry_regex (struct mount_entry *dummy_mount_list, char *regstr, int cflags, int expect, char *desc) |
| 208 | { | 208 | { |
| 209 | int matches = 0; | 209 | int matches = 0; |
| 210 | regex_t re; | 210 | regex_t re; |
| 211 | struct mount_entry *me; | 211 | struct mount_entry *me; |
| @@ -214,7 +214,7 @@ np_test_mount_entry_regex (struct mount_entry *dummy_mount_list, char *regstr, i | |||
| 214 | if(np_regex_match_mount_entry(me,&re)) | 214 | if(np_regex_match_mount_entry(me,&re)) |
| 215 | matches++; | 215 | matches++; |
| 216 | } | 216 | } |
| 217 | ok( matches == expect, | 217 | ok( matches == expect, |
| 218 | "%s '%s' matched %i/3 entries. ok: %i/3", | 218 | "%s '%s' matched %i/3 entries. ok: %i/3", |
| 219 | desc, regstr, expect, matches); | 219 | desc, regstr, expect, matches); |
| 220 | 220 | ||
