diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:46:35 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:46:35 +0000 |
commit | 502af2167f7c218366666ca4944bd7cc54b5b19a (patch) | |
tree | a91fec5cc9769d260640bd91c6633cb9cf395524 /src/util/test_common_logging.c | |
parent | 03af5a603b7cc53432249d5854cd412aa90dde0d (diff) | |
download | gnunet-502af2167f7c218366666ca4944bd7cc54b5b19a.tar.gz gnunet-502af2167f7c218366666ca4944bd7cc54b5b19a.zip |
indentation
Diffstat (limited to 'src/util/test_common_logging.c')
-rw-r--r-- | src/util/test_common_logging.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/src/util/test_common_logging.c b/src/util/test_common_logging.c index 0d038c911..da200d62a 100644 --- a/src/util/test_common_logging.c +++ b/src/util/test_common_logging.c | |||
@@ -31,6 +31,7 @@ my_log (void *ctx, enum GNUNET_ErrorType kind, | |||
31 | const char *component, const char *date, const char *msg) | 31 | const char *component, const char *date, const char *msg) |
32 | { | 32 | { |
33 | unsigned int *c = ctx; | 33 | unsigned int *c = ctx; |
34 | |||
34 | (*c)++; | 35 | (*c)++; |
35 | } | 36 | } |
36 | 37 | ||
@@ -56,26 +57,23 @@ main (int argc, char *argv[]) | |||
56 | /* the last 6 calls should be merged (repated bulk messages!) */ | 57 | /* the last 6 calls should be merged (repated bulk messages!) */ |
57 | GNUNET_logger_remove (&my_log, &logs); | 58 | GNUNET_logger_remove (&my_log, &logs); |
58 | if (logs != 4) | 59 | if (logs != 4) |
59 | { | 60 | { |
60 | fprintf (stdout, "Expected 4 log calls, got %u\n", logs); | 61 | fprintf (stdout, "Expected 4 log calls, got %u\n", logs); |
61 | failureCount++; | 62 | failureCount++; |
62 | } | 63 | } |
63 | GNUNET_break (0 == | 64 | GNUNET_break (0 == |
64 | strcmp (_("ERROR"), | 65 | strcmp (_("ERROR"), |
65 | GNUNET_error_type_to_string | 66 | GNUNET_error_type_to_string (GNUNET_ERROR_TYPE_ERROR))); |
66 | (GNUNET_ERROR_TYPE_ERROR))); | ||
67 | GNUNET_break (0 == | 67 | GNUNET_break (0 == |
68 | strcmp (_("WARNING"), | 68 | strcmp (_("WARNING"), |
69 | GNUNET_error_type_to_string | 69 | GNUNET_error_type_to_string |
70 | (GNUNET_ERROR_TYPE_WARNING))); | 70 | (GNUNET_ERROR_TYPE_WARNING))); |
71 | GNUNET_break (0 == | 71 | GNUNET_break (0 == |
72 | strcmp (_("INFO"), | 72 | strcmp (_("INFO"), |
73 | GNUNET_error_type_to_string | 73 | GNUNET_error_type_to_string (GNUNET_ERROR_TYPE_INFO))); |
74 | (GNUNET_ERROR_TYPE_INFO))); | ||
75 | GNUNET_break (0 == | 74 | GNUNET_break (0 == |
76 | strcmp (_("DEBUG"), | 75 | strcmp (_("DEBUG"), |
77 | GNUNET_error_type_to_string | 76 | GNUNET_error_type_to_string (GNUNET_ERROR_TYPE_DEBUG))); |
78 | (GNUNET_ERROR_TYPE_DEBUG))); | ||
79 | GNUNET_log_setup ("test_common_logging", "WARNING", "/dev/null"); | 77 | GNUNET_log_setup ("test_common_logging", "WARNING", "/dev/null"); |
80 | logs = 0; | 78 | logs = 0; |
81 | GNUNET_logger_add (&my_log, &logs); | 79 | GNUNET_logger_add (&my_log, &logs); |
@@ -83,16 +81,16 @@ main (int argc, char *argv[]) | |||
83 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Drop me...\n"); | 81 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Drop me...\n"); |
84 | GNUNET_logger_remove (&my_log, &logs); | 82 | GNUNET_logger_remove (&my_log, &logs); |
85 | if (logs != 1) | 83 | if (logs != 1) |
86 | { | 84 | { |
87 | fprintf (stdout, "Expected 1 log call, got %u\n", logs); | 85 | fprintf (stdout, "Expected 1 log call, got %u\n", logs); |
88 | failureCount++; | 86 | failureCount++; |
89 | } | 87 | } |
90 | 88 | ||
91 | if (failureCount != 0) | 89 | if (failureCount != 0) |
92 | { | 90 | { |
93 | fprintf (stdout, "%u TESTS FAILED!\n", failureCount); | 91 | fprintf (stdout, "%u TESTS FAILED!\n", failureCount); |
94 | return -1; | 92 | return -1; |
95 | } | 93 | } |
96 | return 0; | 94 | return 0; |
97 | } /* end of main */ | 95 | } /* end of main */ |
98 | 96 | ||