aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_strings.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-13 15:18:35 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-13 15:18:35 +0000
commit2742cca3d2180b4f615c40609fccf10a806f05c8 (patch)
tree7a59d0d43951cec4f0edd903f02ead3dbe037a2f /src/util/test_strings.c
parent832d12049add37805697104b9f8eaae420eef406 (diff)
downloadgnunet-2742cca3d2180b4f615c40609fccf10a806f05c8.tar.gz
gnunet-2742cca3d2180b4f615c40609fccf10a806f05c8.zip
-cleaning up VERBOSE and check nonsense in util tests
Diffstat (limited to 'src/util/test_strings.c')
-rw-r--r--src/util/test_strings.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/util/test_strings.c b/src/util/test_strings.c
index b662623e8..45dd904f4 100644
--- a/src/util/test_strings.c
+++ b/src/util/test_strings.c
@@ -25,13 +25,12 @@
25#include "gnunet_common.h" 25#include "gnunet_common.h"
26#include "gnunet_strings_lib.h" 26#include "gnunet_strings_lib.h"
27 27
28#define VERBOSE GNUNET_NO
29 28
30#define WANT(a,b) if (0 != strcmp(a,b)) { fprintf(stderr, "Got `%s', wanted `%s'\n", b, a); GNUNET_free(b); GNUNET_break(0); return 1;} else { GNUNET_free (b); } 29#define WANT(a,b) if (0 != strcmp(a,b)) { fprintf(stderr, "Got `%s', wanted `%s'\n", b, a); GNUNET_free(b); GNUNET_break(0); return 1;} else { GNUNET_free (b); }
31#define WANTB(a,b,l) if (0 != memcmp(a,b,l)) { GNUNET_break(0); return 1;} else { } 30#define WANTB(a,b,l) if (0 != memcmp(a,b,l)) { GNUNET_break(0); return 1;} else { }
32 31
33static int 32int
34check () 33main (int argc, char *argv[])
35{ 34{
36 char buf[128]; 35 char buf[128];
37 char *r; 36 char *r;
@@ -39,6 +38,7 @@ check ()
39 struct GNUNET_TIME_Absolute at; 38 struct GNUNET_TIME_Absolute at;
40 const char *hdir; 39 const char *hdir;
41 40
41 GNUNET_log_setup ("test_strings", "ERROR", NULL);
42 sprintf (buf, "4 %s", _( /* size unit */ "b")); 42 sprintf (buf, "4 %s", _( /* size unit */ "b"));
43 b = GNUNET_STRINGS_byte_size_fancy (4); 43 b = GNUNET_STRINGS_byte_size_fancy (4);
44 WANT (buf, b); 44 WANT (buf, b);
@@ -106,14 +106,5 @@ check ()
106 return 0; 106 return 0;
107} 107}
108 108
109int
110main (int argc, char *argv[])
111{
112 int ret;
113
114 GNUNET_log_setup ("test_strings", "ERROR", NULL);
115 ret = check ();
116 return ret;
117}
118 109
119/* end of test_strings.c */ 110/* end of test_strings.c */