From 4b9d90f31c700298185aa4c7b20fe1c5e8bf19c2 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Sun, 15 Oct 2023 18:17:36 +0200 Subject: Whitespace fixes in lib --- lib/tests/test_base64.c | 10 +++++----- lib/tests/test_cmd.c | 10 +++++----- lib/tests/test_disk.c | 18 +++++++++--------- lib/tests/test_ini1.c | 10 +++++----- lib/tests/test_ini3.c | 10 +++++----- lib/tests/test_opts2.c | 2 +- lib/tests/test_tcp.c | 14 +++++++------- lib/tests/test_utils.c | 21 ++++++++++----------- 8 files changed, 47 insertions(+), 48 deletions(-) (limited to 'lib/tests') diff --git a/lib/tests/test_base64.c b/lib/tests/test_base64.c index 5103d10d..05dd7943 100644 --- a/lib/tests/test_base64.c +++ b/lib/tests/test_base64.c @@ -1,19 +1,19 @@ /***************************************************************************** -* +* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. -* +* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. -* +* * You should have received a copy of the GNU General Public License * along with this program. If not, see . -* -* +* +* *****************************************************************************/ #include "common.h" diff --git a/lib/tests/test_cmd.c b/lib/tests/test_cmd.c index 4bb60aac..02ae11f5 100644 --- a/lib/tests/test_cmd.c +++ b/lib/tests/test_cmd.c @@ -1,19 +1,19 @@ /***************************************************************************** -* +* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. -* +* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. -* +* * You should have received a copy of the GNU General Public License * along with this program. If not, see . -* -* +* +* *****************************************************************************/ #include "common.h" diff --git a/lib/tests/test_disk.c b/lib/tests/test_disk.c index 9bd68c7a..269d20b6 100644 --- a/lib/tests/test_disk.c +++ b/lib/tests/test_disk.c @@ -1,19 +1,19 @@ /***************************************************************************** -* +* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. -* +* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. -* +* * You should have received a copy of the GNU General Public License * along with this program. If not, see . -* -* +* +* *****************************************************************************/ #include "common.h" @@ -167,7 +167,7 @@ main (int argc, char **argv) } ok(found == 0, "first element successfully deleted"); found = 0; - + p=paths; while (p) { if (! strcmp(p->name, "/tmp")) @@ -203,9 +203,9 @@ main (int argc, char **argv) } -void +void np_test_mount_entry_regex (struct mount_entry *dummy_mount_list, char *regstr, int cflags, int expect, char *desc) -{ +{ int matches = 0; regex_t re; struct mount_entry *me; @@ -214,7 +214,7 @@ np_test_mount_entry_regex (struct mount_entry *dummy_mount_list, char *regstr, i if(np_regex_match_mount_entry(me,&re)) matches++; } - ok( matches == expect, + ok( matches == expect, "%s '%s' matched %i/3 entries. ok: %i/3", desc, regstr, expect, matches); diff --git a/lib/tests/test_ini1.c b/lib/tests/test_ini1.c index 77f88549..6843bac2 100644 --- a/lib/tests/test_ini1.c +++ b/lib/tests/test_ini1.c @@ -1,19 +1,19 @@ /***************************************************************************** -* +* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. -* +* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. -* +* * You should have received a copy of the GNU General Public License * along with this program. If not, see . -* -* +* +* *****************************************************************************/ #include "common.h" diff --git a/lib/tests/test_ini3.c b/lib/tests/test_ini3.c index 814b3ec0..8a2a0414 100644 --- a/lib/tests/test_ini3.c +++ b/lib/tests/test_ini3.c @@ -1,19 +1,19 @@ /***************************************************************************** -* +* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. -* +* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. -* +* * You should have received a copy of the GNU General Public License * along with this program. If not, see . -* -* +* +* *****************************************************************************/ #include "parse_ini.h" diff --git a/lib/tests/test_opts2.c b/lib/tests/test_opts2.c index c3d2067f..780220ee 100644 --- a/lib/tests/test_opts2.c +++ b/lib/tests/test_opts2.c @@ -12,7 +12,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . -* +* *****************************************************************************/ #include "common.h" diff --git a/lib/tests/test_tcp.c b/lib/tests/test_tcp.c index 114252b4..1954b0fb 100644 --- a/lib/tests/test_tcp.c +++ b/lib/tests/test_tcp.c @@ -1,19 +1,19 @@ /***************************************************************************** -* +* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. -* +* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. -* +* * You should have received a copy of the GNU General Public License * along with this program. If not, see . -* -* +* +* *****************************************************************************/ #include "common.h" @@ -33,7 +33,7 @@ main(void) server_expect[0] = strdup("AA"); server_expect[1] = strdup("bb"); server_expect[2] = strdup("CC"); - + ok(np_expect_match("AA bb CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_SUCCESS, "Test matching any string at the beginning (first expect string)"); ok(np_expect_match("bb AA CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_SUCCESS, @@ -52,7 +52,7 @@ main(void) "Test not matching all strings"); ok(np_expect_match("XX XX", server_expect, server_expect_count, NP_MATCH_ALL) == NP_MATCH_RETRY, "Test not matching any string (testing all)"); - + return exit_status(); } diff --git a/lib/tests/test_utils.c b/lib/tests/test_utils.c index 7b10494c..a109e3f4 100644 --- a/lib/tests/test_utils.c +++ b/lib/tests/test_utils.c @@ -1,19 +1,19 @@ /***************************************************************************** -* +* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. -* +* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. -* +* * You should have received a copy of the GNU General Public License * along with this program. If not, see . -* -* +* +* *****************************************************************************/ #include "common.h" @@ -377,13 +377,13 @@ main (int argc, char **argv) /* temp_fp = fopen("var/statefile", "r"); - if (temp_fp==NULL) + if (temp_fp==NULL) printf("Error opening. errno=%d\n", errno); printf("temp_fp=%s\n", temp_fp); - ok( _np_state_read_file(temp_fp) == TRUE, "Can read state file" ); + ok( _np_state_read_file(temp_fp) == true, "Can read state file" ); fclose(temp_fp); */ - + temp_state_key->_filename="var/statefile"; temp_state_data = np_state_read(); ok( this_monitoring_plugin->state->state_data!=NULL, "Got state data now" ) || diag("Are you running in right directory? Will get coredump next if not"); @@ -446,14 +446,14 @@ main (int argc, char **argv) /* Check time is set to current_time */ ok(system("cmp var/generated var/statefile > /dev/null")!=0, "Generated file should be different this time"); ok(this_monitoring_plugin->state->state_data->time-current_time<=1, "Has time generated from current time"); - + /* Don't know how to automatically test this. Need to be able to redefine die and catch the error */ /* temp_state_key->_filename="/dev/do/not/expect/to/be/able/to/write"; np_state_write_string(0, "Bad file"); */ - + np_cleanup(); @@ -508,4 +508,3 @@ main (int argc, char **argv) return exit_status(); } - -- cgit v1.2.3-74-g34f1