aboutsummaryrefslogtreecommitdiff
path: root/src/nat/test_nat_test.c
diff options
context:
space:
mode:
authorChristian Fuchs <christian.fuchs@cfuchs.net>2014-06-08 15:26:55 +0000
committerChristian Fuchs <christian.fuchs@cfuchs.net>2014-06-08 15:26:55 +0000
commita860f03c736a43edf67bd9166eccbae2a553991d (patch)
tree38cb578fe47ccab77d62b13b5b2f103fc51c7e53 /src/nat/test_nat_test.c
parentbddb39798942db2d4a1603487ebbc13d6f5c60bd (diff)
downloadgnunet-a860f03c736a43edf67bd9166eccbae2a553991d.tar.gz
gnunet-a860f03c736a43edf67bd9166eccbae2a553991d.zip
- moved timeout handling responsibility from for nat tests from caller to the library
- updated NAT API accordingly - removed obsolete timeout handling code from gnunet-transport - updated result callback for nat-test gnunet-transport to not always just report success, but we now actually report the proper result code we got from the NAT API - updated nat tests
Diffstat (limited to 'src/nat/test_nat_test.c')
-rw-r--r--src/nat/test_nat_test.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/nat/test_nat_test.c b/src/nat/test_nat_test.c
index 39bd6612e..e8f0f5a47 100644
--- a/src/nat/test_nat_test.c
+++ b/src/nat/test_nat_test.c
@@ -39,23 +39,12 @@ static int ret = 1;
39 39
40static struct GNUNET_NAT_Test *tst; 40static struct GNUNET_NAT_Test *tst;
41 41
42static GNUNET_SCHEDULER_TaskIdentifier end;
43
44static void
45end_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
46{
47 GNUNET_NAT_test_stop (tst);
48}
49
50
51static void 42static void
52report_success (void *cls, 43report_success (void *cls,
53 enum GNUNET_NAT_FailureCode aret) 44 enum GNUNET_NAT_FailureCode aret)
54{ 45{
55 GNUNET_assert (GNUNET_NAT_ERROR_SUCCESS == aret); 46 GNUNET_assert (GNUNET_NAT_ERROR_SUCCESS == aret);
56 ret = 0; 47 ret = 0;
57 GNUNET_SCHEDULER_cancel (end);
58 end = GNUNET_SCHEDULER_add_now (&end_test, NULL);
59} 48}
60 49
61 50
@@ -67,12 +56,9 @@ run (void *cls, char *const *args, const char *cfgfile,
67 const struct GNUNET_CONFIGURATION_Handle *cfg) 56 const struct GNUNET_CONFIGURATION_Handle *cfg)
68{ 57{
69 tst = 58 tst =
70 GNUNET_NAT_test_start (cfg, GNUNET_YES, 1285, 1285, 59 GNUNET_NAT_test_start (cfg, GNUNET_YES, 1285, 1285, TIMEOUT
71 &report_success, 60 &report_success,
72 NULL); 61 NULL);
73 if (NULL == tst)
74 return;
75 end = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_test, NULL);
76} 62}
77 63
78 64