diff options
Diffstat (limited to 'src/nat/test_nat_test.c')
-rw-r--r-- | src/nat/test_nat_test.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/nat/test_nat_test.c b/src/nat/test_nat_test.c index 752c8f145..64425ab47 100644 --- a/src/nat/test_nat_test.c +++ b/src/nat/test_nat_test.c | |||
@@ -47,8 +47,11 @@ end_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
47 | GNUNET_NAT_test_stop (tst); | 47 | GNUNET_NAT_test_stop (tst); |
48 | } | 48 | } |
49 | 49 | ||
50 | |||
50 | static void | 51 | static void |
51 | report_success (void *cls, int success) | 52 | report_success (void *cls, |
53 | int success, | ||
54 | const char *emsg) | ||
52 | { | 55 | { |
53 | GNUNET_assert (GNUNET_OK == success); | 56 | GNUNET_assert (GNUNET_OK == success); |
54 | ret = 0; | 57 | ret = 0; |
@@ -56,6 +59,7 @@ report_success (void *cls, int success) | |||
56 | end = GNUNET_SCHEDULER_add_now (&end_test, NULL); | 59 | end = GNUNET_SCHEDULER_add_now (&end_test, NULL); |
57 | } | 60 | } |
58 | 61 | ||
62 | |||
59 | /** | 63 | /** |
60 | * Main function run with scheduler. | 64 | * Main function run with scheduler. |
61 | */ | 65 | */ |
@@ -64,7 +68,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
64 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 68 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
65 | { | 69 | { |
66 | tst = | 70 | tst = |
67 | GNUNET_NAT_test_start (cfg, GNUNET_YES, 1285, 1285, &report_success, | 71 | GNUNET_NAT_test_start (cfg, GNUNET_YES, 1285, 1285, |
72 | &report_success, | ||
68 | NULL); | 73 | NULL); |
69 | if (NULL == tst) | 74 | if (NULL == tst) |
70 | return; | 75 | return; |
@@ -100,10 +105,12 @@ main (int argc, char *const argv[]) | |||
100 | return 0; | 105 | return 0; |
101 | } | 106 | } |
102 | 107 | ||
103 | gns = | 108 | gns = GNUNET_OS_start_process (GNUNET_YES, |
104 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "gnunet-nat-server", | 109 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
105 | "gnunet-nat-server", | 110 | NULL, NULL, "gnunet-nat-server", |
106 | "-c", "test_nat_test_data.conf", "12345", NULL); | 111 | "gnunet-nat-server", |
112 | "-c", "test_nat_test_data.conf", | ||
113 | "12345", NULL); | ||
107 | GNUNET_assert (NULL != gns); | 114 | GNUNET_assert (NULL != gns); |
108 | GNUNET_PROGRAM_run (3, argv_prog, "test-nat-test", "nohelp", options, &run, | 115 | GNUNET_PROGRAM_run (3, argv_prog, "test-nat-test", "nohelp", options, &run, |
109 | NULL); | 116 | NULL); |
@@ -111,7 +118,8 @@ main (int argc, char *const argv[]) | |||
111 | GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (gns)); | 118 | GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (gns)); |
112 | GNUNET_OS_process_destroy (gns); | 119 | GNUNET_OS_process_destroy (gns); |
113 | if (0 != ret) | 120 | if (0 != ret) |
114 | fprintf (stderr, "NAT test failed to report success\n"); | 121 | fprintf (stderr, |
122 | "NAT test failed to report success\n"); | ||
115 | return ret; | 123 | return ret; |
116 | } | 124 | } |
117 | 125 | ||