new and modified testcases
[oweals/gnunet.git] / src / transport / test_transport_ats.c
1 /*
2      This file is part of GNUnet.
3      (C) 2009 Christian Grothoff (and other contributing authors)
4
5      GNUnet is free software; you can redistribute it and/or modify
6      it under the terms of the GNU General Public License as published
7      by the Free Software Foundation; either version 3, or (at your
8      option) any later version.
9
10      GNUnet is distributed in the hope that it will be useful, but
11      WITHOUT ANY WARRANTY; without even the implied warranty of
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13      General Public License for more details.
14
15      You should have received a copy of the GNU General Public License
16      along with GNUnet; see the file COPYING.  If not, write to the
17      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18      Boston, MA 02111-1307, USA.
19 */
20 /**
21  * @file testing/test_transport_ats.c
22  * @brief testcase for ats functionality without starting peers
23  */
24 #include "platform.h"
25 #include "transport_ats.h"
26 #include "gnunet_configuration_lib.h"
27
28 #define VERBOSE GNUNET_YES
29
30 struct GNUNET_CONFIGURATION_Handle *cfg;
31
32 static struct ATS_Handle * ats;
33
34
35 int init_ats (void)
36 {
37   int ret = 0;
38
39   //ats = ats_init(cfg);
40   //GNUNET_assert (ats != NULL);
41
42   GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
43               "Initializing ATS: %s \n", (ret==0)? "SUCCESFULL": "FAILED");
44   return ret;
45 }
46
47
48 int shutdown_ats (void)
49 {
50   int ret = 0;
51
52   //ats_delete_problem (ats);
53   //ats_shutdown (ats);
54   GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
55               "Shutdown ATS: %s \n", (ret==0)? "SUCCESFULL": "FAILED");
56   return ret;
57 }
58
59 /* To make compiler happy */
60 void dummy(void)
61 {
62   struct ATS_quality_metric * q = qm;
63   q = NULL;
64   struct ATS_ressource * r = ressources;
65   r = NULL;
66 }
67
68 int
69 main (int argc, char *argv[])
70 {
71   int ret = 0;
72
73   GNUNET_log_setup ("test-transport-ats",
74 #if VERBOSE
75                     "DEBUG",
76 #else
77                     "INFO",
78 #endif
79                     NULL);
80 #if !HAVE_LIBGLPK
81   GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
82               "HAVE_LIBGLPK not set, exiting testcase\n");
83 #endif
84
85 #if !HAVE_LIBGLPK
86   return ret;
87 #endif
88
89
90   cfg = GNUNET_CONFIGURATION_create();
91   GNUNET_CONFIGURATION_load(cfg, "test_transport_ats_1addr.conf");
92
93   /* Testing */
94   ats = NULL;
95   ret += init_ats ();
96   ret += shutdown_ats ();
97
98   /* Shutdown */
99   GNUNET_CONFIGURATION_destroy(cfg);
100   return ret;
101
102 }
103
104 /* end of test_transport_ats.c*/