summaryrefslogtreecommitdiffstats
path: root/tap/tests
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2024-11-07 10:58:44 +0100
committerGitHub <noreply@github.com>2024-11-07 10:58:44 +0100
commitb47b5b6fa06ac7ac6f284c7278890f3820100dd8 (patch)
treebe193ae0e79f2620c02d1f41dfad4375511d3033 /tap/tests
parentcace8759c98a1d861c4318afa1d207d869d02646 (diff)
parent00cbf8bcca9d047eead535ebd5bc986365b04426 (diff)
downloadmonitoring-plugins-b47b5b6fa06ac7ac6f284c7278890f3820100dd8.tar.gz
Merge pull request #2036 from RincewindsHat/cleanup/tap
tap: clang-format
Diffstat (limited to 'tap/tests')
-rw-r--r--tap/tests/diag/test.c4
-rw-r--r--tap/tests/fail/test.c4
-rw-r--r--tap/tests/ok/ok-hash/test.c8
-rw-r--r--tap/tests/ok/ok-numeric/test.c4
-rw-r--r--tap/tests/ok/ok/test.c4
-rw-r--r--tap/tests/pass/test.c4
-rw-r--r--tap/tests/plan/no-tests/test.c4
-rw-r--r--tap/tests/plan/no_plan/test.c4
-rw-r--r--tap/tests/plan/not-enough-tests/test.c4
-rw-r--r--tap/tests/plan/sane/test.c4
-rw-r--r--tap/tests/plan/skip_all/test.c4
-rw-r--r--tap/tests/plan/too-many-plans/test.c4
-rw-r--r--tap/tests/plan/too-many-tests/test.c4
-rw-r--r--tap/tests/skip/test.c12
-rw-r--r--tap/tests/todo/test.c6
15 files changed, 22 insertions, 52 deletions
diff --git a/tap/tests/diag/test.c b/tap/tests/diag/test.c
index 401db647..b0a5a4f5 100644
--- a/tap/tests/diag/test.c
+++ b/tap/tests/diag/test.c
@@ -28,9 +28,7 @@
28 28
29#include "tap.h" 29#include "tap.h"
30 30
31int 31int main(int argc, char *argv[]) {
32main(int argc, char *argv[])
33{
34 unsigned int rc = 0; 32 unsigned int rc = 0;
35 33
36 plan_tests(2); 34 plan_tests(2);
diff --git a/tap/tests/fail/test.c b/tap/tests/fail/test.c
index 621b6c29..18e16954 100644
--- a/tap/tests/fail/test.c
+++ b/tap/tests/fail/test.c
@@ -28,9 +28,7 @@
28 28
29#include "tap.h" 29#include "tap.h"
30 30
31int 31int main(int argc, char *argv[]) {
32main(int argc, char *argv[])
33{
34 unsigned int rc = 0; 32 unsigned int rc = 0;
35 33
36 rc = plan_tests(2); 34 rc = plan_tests(2);
diff --git a/tap/tests/ok/ok-hash/test.c b/tap/tests/ok/ok-hash/test.c
index 16be137a..82f65b08 100644
--- a/tap/tests/ok/ok-hash/test.c
+++ b/tap/tests/ok/ok-hash/test.c
@@ -28,9 +28,7 @@
28 28
29#include "tap.h" 29#include "tap.h"
30 30
31int 31int main(int argc, char *argv[]) {
32main(int argc, char *argv[])
33{
34 unsigned int rc = 0; 32 unsigned int rc = 0;
35 33
36 rc = plan_tests(4); 34 rc = plan_tests(4);
@@ -42,11 +40,11 @@ main(int argc, char *argv[])
42 rc = ok(1, "Test with one # hash"); 40 rc = ok(1, "Test with one # hash");
43 diag("Returned: %d", rc); 41 diag("Returned: %d", rc);
44 42
45 rc = ok(1, "Test with # two # hashes"); 43 rc = ok(1, "Test with # two # hashes");
46 diag("Returned: %d", rc); 44 diag("Returned: %d", rc);
47 45
48 rc = ok(1, "Test with ## back to back hashes"); 46 rc = ok(1, "Test with ## back to back hashes");
49 diag("Returned: %d", rc); 47 diag("Returned: %d", rc);
50 48
51 return exit_status(); 49 return exit_status();
52} 50}
diff --git a/tap/tests/ok/ok-numeric/test.c b/tap/tests/ok/ok-numeric/test.c
index 0e33a748..46113f49 100644
--- a/tap/tests/ok/ok-numeric/test.c
+++ b/tap/tests/ok/ok-numeric/test.c
@@ -28,9 +28,7 @@
28 28
29#include "tap.h" 29#include "tap.h"
30 30
31int 31int main(int argc, char *argv[]) {
32main(int argc, char *argv[])
33{
34 unsigned int rc = 0; 32 unsigned int rc = 0;
35 33
36 rc = plan_tests(3); 34 rc = plan_tests(3);
diff --git a/tap/tests/ok/ok/test.c b/tap/tests/ok/ok/test.c
index ae04f2e4..8ef0bcd8 100644
--- a/tap/tests/ok/ok/test.c
+++ b/tap/tests/ok/ok/test.c
@@ -28,9 +28,7 @@
28 28
29#include "tap.h" 29#include "tap.h"
30 30
31int 31int main(int argc, char *argv[]) {
32main(int argc, char *argv[])
33{
34 unsigned int rc = 0; 32 unsigned int rc = 0;
35 33
36 rc = plan_tests(5); 34 rc = plan_tests(5);
diff --git a/tap/tests/pass/test.c b/tap/tests/pass/test.c
index 39d8a7c1..73df20cb 100644
--- a/tap/tests/pass/test.c
+++ b/tap/tests/pass/test.c
@@ -28,9 +28,7 @@
28 28
29#include "tap.h" 29#include "tap.h"
30 30
31int 31int main(int argc, char *argv[]) {
32main(int argc, char *argv[])
33{
34 unsigned int rc = 0; 32 unsigned int rc = 0;
35 33
36 rc = plan_tests(2); 34 rc = plan_tests(2);
diff --git a/tap/tests/plan/no-tests/test.c b/tap/tests/plan/no-tests/test.c
index 78c5d371..f70ec8d3 100644
--- a/tap/tests/plan/no-tests/test.c
+++ b/tap/tests/plan/no-tests/test.c
@@ -28,9 +28,7 @@
28 28
29#include "tap.h" 29#include "tap.h"
30 30
31int 31int main(int argc, char *argv[]) {
32main(int argc, char *argv[])
33{
34 unsigned int rc = 0; 32 unsigned int rc = 0;
35 33
36 rc = plan_tests(0); 34 rc = plan_tests(0);
diff --git a/tap/tests/plan/no_plan/test.c b/tap/tests/plan/no_plan/test.c
index 5cffbdc2..4c25d5f2 100644
--- a/tap/tests/plan/no_plan/test.c
+++ b/tap/tests/plan/no_plan/test.c
@@ -28,9 +28,7 @@
28 28
29#include "tap.h" 29#include "tap.h"
30 30
31int 31int main(int argc, char *argv[]) {
32main(int argc, char *argv[])
33{
34 unsigned int rc = 0; 32 unsigned int rc = 0;
35 33
36 rc = plan_no_plan(); 34 rc = plan_no_plan();
diff --git a/tap/tests/plan/not-enough-tests/test.c b/tap/tests/plan/not-enough-tests/test.c
index a9ec64f2..eacc07eb 100644
--- a/tap/tests/plan/not-enough-tests/test.c
+++ b/tap/tests/plan/not-enough-tests/test.c
@@ -28,9 +28,7 @@
28 28
29#include "tap.h" 29#include "tap.h"
30 30
31int 31int main(int argc, char *argv[]) {
32main(int argc, char *argv[])
33{
34 unsigned int rc = 0; 32 unsigned int rc = 0;
35 33
36 rc = plan_tests(1); 34 rc = plan_tests(1);
diff --git a/tap/tests/plan/sane/test.c b/tap/tests/plan/sane/test.c
index 0843d3af..17bf8d16 100644
--- a/tap/tests/plan/sane/test.c
+++ b/tap/tests/plan/sane/test.c
@@ -28,9 +28,7 @@
28 28
29#include "tap.h" 29#include "tap.h"
30 30
31int 31int main(int argc, char *argv[]) {
32main(int argc, char *argv[])
33{
34 unsigned int rc = 0; 32 unsigned int rc = 0;
35 33
36 rc = plan_tests(1); 34 rc = plan_tests(1);
diff --git a/tap/tests/plan/skip_all/test.c b/tap/tests/plan/skip_all/test.c
index 31722da9..4e37e1ae 100644
--- a/tap/tests/plan/skip_all/test.c
+++ b/tap/tests/plan/skip_all/test.c
@@ -26,9 +26,7 @@
26 26
27#include "tap.h" 27#include "tap.h"
28 28
29int 29int main(int argc, char *argv[]) {
30main(int argc, char *argv[])
31{
32 unsigned int rc = 0; 30 unsigned int rc = 0;
33 31
34 rc = plan_skip_all("No good reason"); 32 rc = plan_skip_all("No good reason");
diff --git a/tap/tests/plan/too-many-plans/test.c b/tap/tests/plan/too-many-plans/test.c
index b189cb72..5f45bc48 100644
--- a/tap/tests/plan/too-many-plans/test.c
+++ b/tap/tests/plan/too-many-plans/test.c
@@ -28,9 +28,7 @@
28 28
29#include "tap.h" 29#include "tap.h"
30 30
31int 31int main(int argc, char *argv[]) {
32main(int argc, char *argv[])
33{
34 unsigned int rc = 0; 32 unsigned int rc = 0;
35 33
36 rc = plan_tests(1); 34 rc = plan_tests(1);
diff --git a/tap/tests/plan/too-many-tests/test.c b/tap/tests/plan/too-many-tests/test.c
index 0f724104..0b2ee161 100644
--- a/tap/tests/plan/too-many-tests/test.c
+++ b/tap/tests/plan/too-many-tests/test.c
@@ -28,9 +28,7 @@
28 28
29#include "tap.h" 29#include "tap.h"
30 30
31int 31int main(int argc, char *argv[]) {
32main(int argc, char *argv[])
33{
34 unsigned int rc = 0; 32 unsigned int rc = 0;
35 33
36 rc = plan_tests(5); 34 rc = plan_tests(5);
diff --git a/tap/tests/skip/test.c b/tap/tests/skip/test.c
index d8f3eafd..789812e2 100644
--- a/tap/tests/skip/test.c
+++ b/tap/tests/skip/test.c
@@ -28,29 +28,27 @@
28 28
29#include "tap.h" 29#include "tap.h"
30 30
31int 31int main(int argc, char *argv[]) {
32main(int argc, char *argv[])
33{
34 unsigned int rc = 0; 32 unsigned int rc = 0;
35 unsigned int side_effect = 0; 33 unsigned int side_effect = 0;
36 34
37 rc = plan_tests(4); 35 rc = plan_tests(4);
38 diag("Returned: %d", rc); 36 diag("Returned: %d", rc);
39 37
40 rc = ok(1 == 1, "1 equals 1"); /* Should always work */ 38 rc = ok(1 == 1, "1 equals 1"); /* Should always work */
41 diag("Returned: %d", rc); 39 diag("Returned: %d", rc);
42 40
43 do { 41 do {
44 if(1) { 42 if (1) {
45 rc = skip(1, "Testing skipping"); 43 rc = skip(1, "Testing skipping");
46 continue; 44 continue;
47 } 45 }
48 46
49 side_effect++; 47 side_effect++;
50 48
51 ok(side_effect == 1, "side_effect checked out"); 49 ok(side_effect == 1, "side_effect checked out");
52 50
53 } while(0); 51 } while (0);
54 52
55 diag("Returned: %d", rc); 53 diag("Returned: %d", rc);
56 54
diff --git a/tap/tests/todo/test.c b/tap/tests/todo/test.c
index ac6339a7..0cd2fb3f 100644
--- a/tap/tests/todo/test.c
+++ b/tap/tests/todo/test.c
@@ -28,16 +28,14 @@
28 28
29#include "tap.h" 29#include "tap.h"
30 30
31int 31int main(int argc, char *argv[]) {
32main(int argc, char *argv[])
33{
34 unsigned int rc = 0; 32 unsigned int rc = 0;
35 unsigned int side_effect = 0; 33 unsigned int side_effect = 0;
36 34
37 rc = plan_tests(5); 35 rc = plan_tests(5);
38 diag("Returned: %d", rc); 36 diag("Returned: %d", rc);
39 37
40 rc = ok(1 == 1, "1 equals 1"); /* Should always work */ 38 rc = ok(1 == 1, "1 equals 1"); /* Should always work */
41 diag("Returned: %d", rc); 39 diag("Returned: %d", rc);
42 40
43 todo_start("For testing purposes"); 41 todo_start("For testing purposes");