#include "gnunet_server_lib.h"
#include "gnunet_time_lib.h"
-#define VERBOSE GNUNET_NO
#define PORT 14325
}
-/**
- * Main method, starts scheduler with task1,
- * checks that "ok" is correct at the end.
- */
-static int
-check ()
+int
+main (int argc, char *argv[])
{
int ok;
+ GNUNET_log_setup ("test_client",
+ "WARNING",
+ NULL);
cfg = GNUNET_CONFIGURATION_create ();
GNUNET_CONFIGURATION_set_value_number (cfg, MYNAME, "PORT", PORT);
GNUNET_CONFIGURATION_set_value_string (cfg, MYNAME, "HOSTNAME", "localhost");
return ok;
}
-int
-main (int argc, char *argv[])
-{
- int ret = 0;
-
- GNUNET_log_setup ("test_client",
-#if VERBOSE
- "DEBUG",
-#else
- "WARNING",
-#endif
- NULL);
- ret += check ();
-
- return ret;
-}
-
/* end of test_client.c */
runone ();
}
-/**
- * Main method, starts scheduler with task1,
- * checks that "ok" is correct at the end.
- */
-static int
-check ()
-{
- ok = 1;
- GNUNET_SCHEDULER_run (&task, &ok);
- return ok;
-}
-
int
main (int argc, char *argv[])
{
- int ret;
-
GNUNET_log_setup ("test-common-logging-runtime-loglevels",
-#if VERBOSE
- "DEBUG",
-#else
"WARNING",
-#endif
NULL);
- ret = check ();
-
- return ret;
+ ok = 1;
+ GNUNET_SCHEDULER_run (&task, &ok);
+ return ok;
}
/* end of test_common_logging_runtime_loglevels.c */
#include "gnunet_scheduler_lib.h"
#include "gnunet_time_lib.h"
-#define VERBOSE GNUNET_NO
-
#define PORT 12435
{
int *ok = cls;
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receive validates incoming data\n");
-#endif
GNUNET_assert (buf != NULL); /* no timeout */
if (0 == memcmp (&"Hello World"[sofar], buf, available))
sofar += available;
if (sofar < 12)
{
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receive needs more data\n");
-#endif
GNUNET_CONNECTION_receive (asock, 1024,
GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_SECONDS, 5), &receive_check,
}
else
{
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receive closes accepted socket\n");
-#endif
*ok = 0;
GNUNET_CONNECTION_destroy (asock);
GNUNET_CONNECTION_destroy (csock);
static void
run_accept (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test accepts connection\n");
-#endif
asock = GNUNET_CONNECTION_create_from_accept (NULL, NULL, ls);
GNUNET_assert (asock != NULL);
GNUNET_assert (GNUNET_YES == GNUNET_CONNECTION_check (asock));
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test destroys listen socket\n");
-#endif
GNUNET_CONNECTION_destroy (lsock);
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Test asks to receive on accepted socket\n");
-#endif
GNUNET_CONNECTION_receive (asock, 1024,
GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_SECONDS, 5), &receive_check,
cls);
}
+
static size_t
make_hello (void *cls, size_t size, void *buf)
{
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Test prepares to transmit on connect socket\n");
-#endif
GNUNET_assert (size >= 12);
strcpy ((char *) buf, "Hello World");
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test destroys client socket\n");
-#endif
return 12;
}
+
static void
task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_assert (lsock != NULL);
csock = GNUNET_CONNECTION_create_from_connect (cfg, "localhost", PORT);
GNUNET_assert (csock != NULL);
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test asks for write notification\n");
-#endif
GNUNET_assert (NULL !=
GNUNET_CONNECTION_notify_transmit_ready (csock, 12,
GNUNET_TIME_UNIT_SECONDS,
&make_hello, NULL));
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test prepares to accept\n");
-#endif
GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, ls, &run_accept,
cls);
}
-/**
- * Main method, starts scheduler with task ,
- * checks that "ok" is correct at the end.
- */
-static int
-check ()
+int
+main (int argc, char *argv[])
{
int ok;
+ GNUNET_log_setup ("test_connection",
+ "WARNING",
+ NULL);
+
ok = 1;
cfg = GNUNET_CONFIGURATION_create ();
GNUNET_CONFIGURATION_set_value_string (cfg, "resolver", "HOSTNAME",
return ok;
}
-
-
-int
-main (int argc, char *argv[])
-{
- int ret = 0;
-
- GNUNET_log_setup ("test_connection",
-#if VERBOSE
- "DEBUG",
-#else
- "WARNING",
-#endif
- NULL);
- ret += check ();
- return ret;
-}
-
/* end of test_connection.c */
#include "gnunet_scheduler_lib.h"
#include "gnunet_time_lib.h"
-#define VERBOSE GNUNET_NO
#define PORT 12435
}
-/**
- * Main method, starts scheduler with task ,
- * checks that "ok" is correct at the end.
- */
-static int
-check ()
-{
- int ok;
-
- ok = 1;
- GNUNET_SCHEDULER_run (&task, &ok);
- return ok;
-}
-
-
-
int
main (int argc, char *argv[])
{
- int ret = 0;
+ int ok;
GNUNET_log_setup ("test_connection_addressing",
-#if VERBOSE
- "DEBUG",
-#else
"WARNING",
-#endif
NULL);
- ret += check ();
- return ret;
+ ok = 1;
+ GNUNET_SCHEDULER_run (&task, &ok);
+ return ok;
}
/* end of test_connection_addressing.c */
#include "gnunet_scheduler_lib.h"
#include "gnunet_time_lib.h"
-#define VERBOSE GNUNET_NO
-
#define PORT 12435
#include "gnunet_scheduler_lib.h"
#include "gnunet_time_lib.h"
-#define VERBOSE GNUNET_NO
-
#define PORT 12435
static struct GNUNET_CONNECTION_Handle *csock;
if (size == 0)
{
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got the desired timeout!\n");
-#endif
GNUNET_assert (buf == NULL);
*ok = 0;
GNUNET_CONNECTION_destroy (lsock);
GNUNET_CONNECTION_destroy (csock);
return 0;
}
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending kilo to fill buffer.\n");
-#endif
GNUNET_assert (size >= 1024);
memset (buf, 42, 1024);
}
-
-/**
- * Main method, starts scheduler with task_timeout.
- */
-static int
-check_timeout ()
+int
+main (int argc, char *argv[])
{
int ok;
+ GNUNET_log_setup ("test_connection_timeout",
+ "WARNING",
+ NULL);
+
ok = 1;
cfg = GNUNET_CONFIGURATION_create ();
GNUNET_CONFIGURATION_set_value_string (cfg, "resolver", "HOSTNAME",
return ok;
}
-int
-main (int argc, char *argv[])
-{
- int ret = 0;
-
- GNUNET_log_setup ("test_connection_timeout",
-#if VERBOSE
- "DEBUG",
-#else
- "WARNING",
-#endif
- NULL);
- ret += check_timeout ();
- return ret;
-}
-
/* end of test_connection_timeout.c */
#include "gnunet_scheduler_lib.h"
#include "gnunet_time_lib.h"
-#define VERBOSE GNUNET_NO
-
#define PORT 13425
static struct GNUNET_CONNECTION_Handle *csock;
{
int *ok = cls;
-#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received timeout signal.\n");
-#endif
-
GNUNET_assert (size == 0);
GNUNET_assert (buf == NULL);
*ok = 0;
}
-
-/**
- * Main method, starts scheduler with task_timeout.
- */
-static int
-check_timeout ()
+int
+main (int argc, char *argv[])
{
int ok;
+ GNUNET_log_setup ("test_connection_timeout_no_connect",
+ "WARNING",
+ NULL);
ok = 1;
cfg = GNUNET_CONFIGURATION_create ();
GNUNET_CONFIGURATION_set_value_string (cfg, "resolver", "HOSTNAME",
return ok;
}
-int
-main (int argc, char *argv[])
-{
- int ret = 0;
-
- GNUNET_log_setup ("test_connection_timeout_no_connect",
-#if VERBOSE
- "DEBUG",
-#else
- "WARNING",
-#endif
- NULL);
- ret += check_timeout ();
- return ret;
-}
-
/* end of test_connection_timeout_no_connect.c */
#include "gnunet_scheduler_lib.h"
#include "gnunet_time_lib.h"
-#define VERBOSE GNUNET_NO
-
#define PORT 12435
static struct GNUNET_CONFIGURATION_Handle *cfg;
}
-
-
-/**
- * Main method, starts scheduler with task_timeout.
- */
-static int
-check_transmit_cancel ()
+int
+main (int argc, char *argv[])
{
int ok;
+ GNUNET_log_setup ("test_connection_transmit_cancel",
+ "WARNING",
+ NULL);
ok = 1;
cfg = GNUNET_CONFIGURATION_create ();
GNUNET_CONFIGURATION_set_value_string (cfg, "resolver", "HOSTNAME",
return ok;
}
-
-int
-main (int argc, char *argv[])
-{
- int ret = 0;
-
- GNUNET_log_setup ("test_connection_transmit_cancel",
-#if VERBOSE
- "DEBUG",
-#else
- "WARNING",
-#endif
- NULL);
- ret += check_transmit_cancel ();
-
- return ret;
-}
-
/* end of test_connection_transmit_cancel.c */
#include "gnunet_configuration_lib.h"
#include "gnunet_getopt_lib.h"
-#define VERBOSE 0
static int
testMinimal ()
return 0;
}
+
static int
testVerbose ()
{
return 0;
}
+
static int
testVersion ()
{
return 0;
}
+
static int
testAbout ()
{
return 0;
}
+
static int
testLogOpts ()
{
return 0;
}
+
static int
testFlagNum ()
{
return 0;
}
+
int
main (int argc, char *argv[])
{
#include "gnunet_configuration_lib.h"
#include "gnunet_os_lib.h"
-#define VERBOSE 1
/**
* Check if the address we got is IPv4 or IPv6 loopback (which should
{
int *ok = cls;
char buf[INET6_ADDRSTRLEN];
+ const char * protocol;
if (NULL == addr)
return GNUNET_OK;
-#if VERBOSE
- const char * protocol;
if (addrlen == sizeof (struct sockaddr_in))
protocol = "IPv4";
else
protocol = "IPv6";
- printf ("%s Address `%s'\n", protocol, GNUNET_a2s ((const struct sockaddr *) addr,addrlen) );
- printf (" Netmask `%s'\n", GNUNET_a2s ((const struct sockaddr *) netmask, addrlen) );
- printf (" Broadcast `%s'\n", GNUNET_a2s ((const struct sockaddr *) broadcast_addr,addrlen) );
-#endif
-
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "%s Address `%s'\n", protocol, GNUNET_a2s ((const struct sockaddr *) addr,addrlen) );
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Netmask `%s'\n", GNUNET_a2s ((const struct sockaddr *) netmask, addrlen) );
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "`%s'\n", GNUNET_a2s ((const struct sockaddr *) broadcast_addr,addrlen) );
inet_ntop (addr->sa_family,
(addr->sa_family ==
AF_INET) ? (void *) &((struct sockaddr_in *) addr)->sin_addr
return GNUNET_OK;
}
-static int
-testifcs ()
+
+int
+main (int argc, char *argv[])
{
int ret;
+ GNUNET_log_setup ("test-os-network", "WARNING", NULL);
ret = 1;
GNUNET_OS_network_interfaces_list (&proc, &ret);
return ret;
}
-int
-main (int argc, char *argv[])
-{
- int errCnt = 0;
-
- GNUNET_log_setup ("test-os-network", "WARNING", NULL);
- if (0 != testifcs ())
- errCnt++;
- return errCnt;
-}
+/* end of test_os_network.c */
#include "gnunet_common.h"
#include "gnunet_os_lib.h"
-#define VERBOSE 0
static int
testprio ()
#include "gnunet_scheduler_lib.h"
#include "disk.h"
-#define VERBOSE GNUNET_NO
-static char *test_phrase = "HELLO WORLD";
+static const char *test_phrase = "HELLO WORLD";
+
static int ok;
static struct GNUNET_OS_Process *proc;
-/* Pipe to write to started processes stdin (on write end) */
+/**
+ * Pipe to write to started processes stdin (on write end)
+ */
static struct GNUNET_DISK_PipeHandle *hello_pipe_stdin;
-/* Pipe to read from started processes stdout (on read end) */
+/**
+ * Pipe to read from started processes stdout (on read end)
+ */
static struct GNUNET_DISK_PipeHandle *hello_pipe_stdout;
static GNUNET_SCHEDULER_TaskIdentifier die_task;
+
static void
end_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_DISK_pipe_close (hello_pipe_stdin);
}
+
static void
read_call (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
bytes = GNUNET_DISK_file_read (stdout_read_handle, &buf, sizeof (buf));
-#if VERBOSE
- FPRINTF (stderr, "bytes is %d\n", bytes);
-#endif
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "bytes is %d\n", bytes);
if (bytes < 1)
{
}
ok = strncmp (&buf[0], test_phrase, strlen (test_phrase));
-#if VERBOSE
- FPRINTF (stderr, "read %s\n", &buf[0]);
-#endif
- if (ok == 0)
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "read %s\n", &buf[0]);
+ if (0 == ok)
{
GNUNET_SCHEDULER_cancel (die_task);
GNUNET_SCHEDULER_add_now (&end_task, NULL);
proc =
GNUNET_OS_start_process (GNUNET_YES, hello_pipe_stdin, hello_pipe_stdout, "cat",
"gnunet-service-resolver", "-", NULL);
- sleep (1); /* give process time to start and open pipe */
+ sleep (1); /* give process time to start, so we actually use the pipe-kill mechanism! */
if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
- {
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
- }
GNUNET_assert (GNUNET_OK == GNUNET_OS_process_wait (proc));
GNUNET_OS_process_destroy (proc);
proc = NULL;
int ret;
GNUNET_log_setup ("test-os-start-process",
-#if VERBOSE
- "DEBUG",
-#else
"WARNING",
-#endif
NULL);
ret = 0;
ret |= check_run ();
ret |= check_kill ();
ret |= check_instant_kill ();
-
return ret;
}
+
+/* end of test_os_start_process.c */
#define NUMBER_OF_PEERS 10
-#define VERBOSE GNUNET_NO
-
/**
* A list of Peer ID's to play with
*/
{
GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK,
&pidArr[i].hashPubKey);
-#if VERBOSE
- printf ("Peer %d: %s\n", i, GNUNET_i2s (&pidArr[i]));
-#endif
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Peer %d: %s\n", i, GNUNET_i2s (&pidArr[i]));
}
}
int
main ()
{
- int i;
+ unsigned int i;
GNUNET_log_setup ("test-peer", "ERROR", NULL);
for (i = 0; i < 1; i++)
#include "platform.h"
#include "gnunet_plugin_lib.h"
-#define VERBOSE GNUNET_NO
static void
test_cb (void *cls, const char *libname, void *lib_ret)
}
-static int
-check ()
+int
+main (int argc, char *argv[])
{
void *ret;
+ GNUNET_log_setup ("test-plugin", "WARNING", NULL);
GNUNET_log_skip (1, GNUNET_NO);
ret = GNUNET_PLUGIN_load ("libgnunet_plugin_missing", NULL);
GNUNET_log_skip (0, GNUNET_NO);
ret = GNUNET_PLUGIN_load ("libgnunet_plugin_test", "in");
if (ret == NULL)
return 1;
- if (0 != strcmp (ret, "Hello"))
+ if (0 != strcmp (ret, "Hello"))
return 2;
ret = GNUNET_PLUGIN_unload ("libgnunet_plugin_test", "out");
if (ret == NULL)
if (0 != strcmp (ret, "World"))
return 4;
free (ret);
-
GNUNET_PLUGIN_load_all ("libgnunet_plugin_tes", "in", &test_cb, "test");
return 0;
}
-int
-main (int argc, char *argv[])
-{
- int ret;
-
- GNUNET_log_setup ("test-plugin", "WARNING", NULL);
- ret = check ();
-
- return ret;
-}
-
/* end of test_plugin.c */
#include "gnunet_time_lib.h"
#include "gnunet_disk_lib.h"
-#define VERBOSE GNUNET_NO
+
+struct GNUNET_DISK_PipeHandle *p;
+
+static const struct GNUNET_DISK_FileHandle *fds[2];
+
static void
task2 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
(*ok) = 4;
}
-struct GNUNET_DISK_PipeHandle *p;
-static const struct GNUNET_DISK_FileHandle *fds[2];
-
static void
taskWrt (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_assert (0);
}
+
static void
taskLast (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
(*ok) = 0;
}
+
static void
taskRd (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
}
-
/**
* Main method, starts scheduler with task1,
* checks that "ok" is correct at the end.
}
-
int
main (int argc, char *argv[])
{
#include "gnunet_scheduler_lib.h"
#include "gnunet_time_lib.h"
-#define VERBOSE GNUNET_NO
-
static struct GNUNET_TIME_Absolute target;
static int i;
i += INCR;
}
-static int
-check ()
+
+int
+main (int argc, char *argv[])
{
+ int ret;
+
+ GNUNET_log_setup ("test-scheduler-delay", "WARNING", NULL);
target = GNUNET_TIME_absolute_get ();
GNUNET_SCHEDULER_run (&test_task, NULL);
FPRINTF (stdout, "Sleep precision: %llu ms. ",
return 0;
}
-int
-main (int argc, char *argv[])
-{
- int ret;
-
- GNUNET_log_setup ("test-scheduler-delay", "WARNING", NULL);
- ret = check ();
-
- return ret;
-}
-
/* end of test_scheduler_delay.c */
#include "gnunet_server_lib.h"
#include "gnunet_time_lib.h"
-#define VERBOSE GNUNET_NO
-
#define PORT 12435
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 2)
#include "gnunet_server_lib.h"
#include "gnunet_time_lib.h"
-#define VERBOSE GNUNET_NO
#define PORT 12435
#include "gnunet_server_lib.h"
#include "gnunet_time_lib.h"
-#define VERBOSE GNUNET_NO
-
#define PORT 22335
#define MY_TYPE 128
}
-/**
- * Main method, starts scheduler with task1,
- * checks that "ok" is correct at the end.
- */
-static int
-check ()
-{
-
- ok = 1;
- GNUNET_SCHEDULER_run (&task, NULL);
- return ok;
-}
-
-
int
main (int argc, char *argv[])
{
- int ret = 0;
-
GNUNET_log_setup ("test_server_with_client",
-#if VERBOSE
- "DEBUG",
-#else
"WARNING",
-#endif
NULL);
- ret += check ();
-
- return ret;
+ ok = 1;
+ GNUNET_SCHEDULER_run (&task, NULL);
+ return ok;
}
/* end of test_server_with_client.c */
#include "gnunet_server_lib.h"
#include "gnunet_time_lib.h"
-#define VERBOSE GNUNET_NO
-
#define MY_TYPE 128
static int ok;
+
static void
send_done (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
un.sun_path[0] = '\0';
#endif
-
sap[0] = (struct sockaddr *) &un;
slens[0] = sizeof (un);
sap[1] = NULL;
}
-/**
- * Main method, starts scheduler with task1,
- * checks that "ok" is correct at the end.
- */
-static int
-check ()
-{
-
- ok = 1;
- GNUNET_SCHEDULER_run (&task, NULL);
- return ok;
-}
-
-
int
main (int argc, char *argv[])
{
- int ret = 0;
-
GNUNET_log_setup ("test_server_with_client_unix",
-#if VERBOSE
- "DEBUG",
-#else
"WARNING",
-#endif
NULL);
- ret += check ();
-
- return ret;
+ ok = 1;
+ GNUNET_SCHEDULER_run (&task, NULL);
+ return ok;
}
/* end of test_server_with_client_unix.c */
#include "gnunet_time_lib.h"
-#define VERBOSE GNUNET_NO
-
#define PORT 12435
#define MY_TYPE 256
"test_service",
"-c",
"test_service_data.conf",
- "-L",
-#if VERBOSE
- "DEBUG",
-#else
- "WARNING",
-#endif
NULL
};
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting service\n");
GNUNET_assert (GNUNET_OK ==
- GNUNET_SERVICE_run (5, argv, "test_service",
+ GNUNET_SERVICE_run (3, argv, "test_service",
GNUNET_SERVICE_OPTION_NONE, &runner, &ok));
GNUNET_assert (0 == ok);
return ok;
"test_service6",
"-c",
"test_service_data.conf",
- "-L",
-#if VERBOSE
- "DEBUG",
-#else
- "WARNING",
-#endif
NULL
};
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting v6 service\n");
GNUNET_assert (GNUNET_OK ==
- GNUNET_SERVICE_run (5, argv, "test_service6",
+ GNUNET_SERVICE_run (3, argv, "test_service6",
GNUNET_SERVICE_OPTION_NONE, &runner6,
&ok));
GNUNET_assert (0 == ok);
"test-service-program",
"-c",
"test_service_data.conf",
- "-L",
-#if VERBOSE
- "DEBUG",
-#else
- "WARNING",
-#endif
NULL
};
const struct GNUNET_GETOPT_CommandLineOption options[] = {
int ret = 1;
GNUNET_assert (GNUNET_OK ==
- GNUNET_PROGRAM_run (5, argv, "test-service-program", "no help",
+ GNUNET_PROGRAM_run (3, argv, "test-service-program", "no help",
options, &start_stop_main, &ret));
-
+
GNUNET_break (0 == ret);
return ret;
}
struct GNUNET_NETWORK_Handle *s = NULL;
GNUNET_log_setup ("test-service",
-#if VERBOSE
- "DEBUG",
-#else
"WARNING",
-#endif
NULL);
ret += check ();
ret += check ();
#include "gnunet_common.h"
#include "gnunet_strings_lib.h"
-#define VERBOSE GNUNET_NO
#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); }
#define WANTB(a,b,l) if (0 != memcmp(a,b,l)) { GNUNET_break(0); return 1;} else { }
-static int
-check ()
+int
+main (int argc, char *argv[])
{
char buf[128];
char *r;
struct GNUNET_TIME_Absolute at;
const char *hdir;
+ GNUNET_log_setup ("test_strings", "ERROR", NULL);
sprintf (buf, "4 %s", _( /* size unit */ "b"));
b = GNUNET_STRINGS_byte_size_fancy (4);
WANT (buf, b);
return 0;
}
-int
-main (int argc, char *argv[])
-{
- int ret;
-
- GNUNET_log_setup ("test_strings", "ERROR", NULL);
- ret = check ();
- return ret;
-}
/* end of test_strings.c */
#include "gnunet_common.h"
#include "gnunet_time_lib.h"
-#define VERBOSE GNUNET_NO
-static int
-check ()
+int
+main (int argc, char *argv[])
{
struct GNUNET_TIME_Absolute now;
struct GNUNET_TIME_AbsoluteNBO nown;
struct GNUNET_TIME_RelativeNBO reln;
unsigned int i;
+ GNUNET_log_setup ("test-time", "WARNING", NULL);
forever = GNUNET_TIME_UNIT_FOREVER_ABS;
relForever = GNUNET_TIME_UNIT_FOREVER_REL;
relUnit = GNUNET_TIME_UNIT_MILLISECONDS;
return 0;
}
-int
-main (int argc, char *argv[])
-{
- int ret;
-
- GNUNET_log_setup ("test-time", "WARNING", NULL);
- ret = check ();
-
- return ret;
-}
/* end of test_time.c */