diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-09-11 06:38:27 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-09-11 06:38:27 +0000 |
commit | 584b336bb53fbe434a2c8e29874ec657b89fcfce (patch) | |
tree | 23756285c57f5c91cdfe9c3ca671f4ba79edeadd /src | |
parent | 0bd9307938d812b878e6e4ac7a9de93071e5f3e3 (diff) | |
download | gnunet-584b336bb53fbe434a2c8e29874ec657b89fcfce.tar.gz gnunet-584b336bb53fbe434a2c8e29874ec657b89fcfce.zip |
- rename test according to what is tested
- added additional checks
Diffstat (limited to 'src')
-rw-r--r-- | src/namestore/Makefile.am | 8 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_store.c (renamed from src/namestore/test_namestore_api.c) | 13 |
2 files changed, 14 insertions, 7 deletions
diff --git a/src/namestore/Makefile.am b/src/namestore/Makefile.am index a3874a922..6a3ce7da9 100644 --- a/src/namestore/Makefile.am +++ b/src/namestore/Makefile.am | |||
@@ -41,7 +41,7 @@ if HAVE_EXPERIMENTAL | |||
41 | 41 | ||
42 | if HAVE_TESTING | 42 | if HAVE_TESTING |
43 | TESTING_TESTS = \ | 43 | TESTING_TESTS = \ |
44 | test_namestore_api \ | 44 | test_namestore_api_store \ |
45 | test_namestore_api_remove \ | 45 | test_namestore_api_remove \ |
46 | test_namestore_api_lookup | 46 | test_namestore_api_lookup |
47 | #test_namestore_api_lookup_specific_type | 47 | #test_namestore_api_lookup_specific_type |
@@ -180,9 +180,9 @@ test_namestore_api_blocks_LDADD = \ | |||
180 | $(top_builddir)/src/testing/libgnunettesting.la \ | 180 | $(top_builddir)/src/testing/libgnunettesting.la \ |
181 | $(top_builddir)/src/namestore/libgnunetnamestore.la | 181 | $(top_builddir)/src/namestore/libgnunetnamestore.la |
182 | 182 | ||
183 | test_namestore_api_SOURCES = \ | 183 | test_namestore_api_store_SOURCES = \ |
184 | test_namestore_api.c | 184 | test_namestore_api_store.c |
185 | test_namestore_api_LDADD = \ | 185 | test_namestore_api_store_LDADD = \ |
186 | $(top_builddir)/src/testing/libgnunettesting.la \ | 186 | $(top_builddir)/src/testing/libgnunettesting.la \ |
187 | $(top_builddir)/src/util/libgnunetutil.la \ | 187 | $(top_builddir)/src/util/libgnunetutil.la \ |
188 | $(top_builddir)/src/namestore/libgnunetnamestore.la | 188 | $(top_builddir)/src/namestore/libgnunetnamestore.la |
diff --git a/src/namestore/test_namestore_api.c b/src/namestore/test_namestore_api_store.c index ac5cb5a9b..b85003c60 100644 --- a/src/namestore/test_namestore_api.c +++ b/src/namestore/test_namestore_api_store.c | |||
@@ -19,7 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @file namestore/test_namestore_api.c | 21 | * @file namestore/test_namestore_api.c |
22 | * @brief testcase for namestore_api.c | 22 | * @brief testcase for namestore_api.c: store a record and perform a lookup |
23 | */ | 23 | */ |
24 | #include "platform.h" | 24 | #include "platform.h" |
25 | #include "gnunet_common.h" | 25 | #include "gnunet_common.h" |
@@ -132,10 +132,11 @@ name_lookup_proc (void *cls, | |||
132 | if (NULL == block) | 132 | if (NULL == block) |
133 | { | 133 | { |
134 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 134 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
135 | "Namestore returned no block\n"); | 135 | _("Namestore returned no block\n")); |
136 | if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) | 136 | if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) |
137 | GNUNET_SCHEDULER_cancel (endbadly_task); | 137 | GNUNET_SCHEDULER_cancel (endbadly_task); |
138 | endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); | 138 | endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); |
139 | return; | ||
139 | } | 140 | } |
140 | 141 | ||
141 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 142 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -197,6 +198,12 @@ run (void *cls, | |||
197 | GNUNET_break (NULL != nsh); | 198 | GNUNET_break (NULL != nsh); |
198 | nsqe = GNUNET_NAMESTORE_records_store (nsh, privkey, name, | 199 | nsqe = GNUNET_NAMESTORE_records_store (nsh, privkey, name, |
199 | 1, &rd, &put_cont, (void *) name); | 200 | 1, &rd, &put_cont, (void *) name); |
201 | if (NULL == nsqe) | ||
202 | { | ||
203 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
204 | _("Namestore cannot store no block\n")); | ||
205 | } | ||
206 | |||
200 | GNUNET_free ((void *)rd.data); | 207 | GNUNET_free ((void *)rd.data); |
201 | } | 208 | } |
202 | 209 | ||