diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-11-22 19:06:54 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-11-22 19:06:54 +0000 |
commit | 12586cd08b2d8f797ef1a63501def72d5c875cf8 (patch) | |
tree | 8eb8cf55b8f6f5b5d3150df3d885d5b58cc3f0fb | |
parent | 02f21c08e22a6b04030b4eb990fa5046e79e00b3 (diff) | |
download | gnunet-12586cd08b2d8f797ef1a63501def72d5c875cf8.tar.gz gnunet-12586cd08b2d8f797ef1a63501def72d5c875cf8.zip |
fixes
-rw-r--r-- | src/util/test_configuration.c | 12 | ||||
-rw-r--r-- | src/util/test_resolver_api.c | 5 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/util/test_configuration.c b/src/util/test_configuration.c index 609f797bd..7d87d03a8 100644 --- a/src/util/test_configuration.c +++ b/src/util/test_configuration.c | |||
@@ -117,6 +117,8 @@ diffsCallBack (void *cls, | |||
117 | { | 117 | { |
118 | int ret; | 118 | int ret; |
119 | char *diffValue; | 119 | char *diffValue; |
120 | |||
121 | diffValue = NULL; | ||
120 | ret = | 122 | ret = |
121 | GNUNET_CONFIGURATION_get_value_string (cbData->cfgDiffs, section, | 123 | GNUNET_CONFIGURATION_get_value_string (cbData->cfgDiffs, section, |
122 | option, &diffValue); | 124 | option, &diffValue); |
@@ -127,6 +129,7 @@ diffsCallBack (void *cls, | |||
127 | } | 129 | } |
128 | else | 130 | else |
129 | cbData->status = 1; | 131 | cbData->status = 1; |
132 | GNUNET_free_non_null (diffValue); | ||
130 | break; | 133 | break; |
131 | } | 134 | } |
132 | #if DEBUG | 135 | #if DEBUG |
@@ -180,6 +183,7 @@ editConfiguration (struct GNUNET_CONFIGURATION_Handle *cfg, int option) | |||
180 | GNUNET_CONFIGURATION_set_value_string (diffsCB.cfgDiffs, | 183 | GNUNET_CONFIGURATION_set_value_string (diffsCB.cfgDiffs, |
181 | "new-section", key, | 184 | "new-section", key, |
182 | "new-value"); | 185 | "new-value"); |
186 | GNUNET_free (key); | ||
183 | } | 187 | } |
184 | break; | 188 | break; |
185 | } | 189 | } |
@@ -209,12 +213,15 @@ checkDiffs (struct GNUNET_CONFIGURATION_Handle *cfgDefault, int option) | |||
209 | initDiffsCBData (&cbData); | 213 | initDiffsCBData (&cbData); |
210 | 214 | ||
211 | cfg = GNUNET_CONFIGURATION_create (); | 215 | cfg = GNUNET_CONFIGURATION_create (); |
212 | GNUNET_CONFIGURATION_load (cfg, NULL); | 216 | /* load defaults */ |
217 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (cfg, NULL)); | ||
213 | 218 | ||
214 | /* Modify configuration and save it */ | 219 | /* Modify configuration and save it */ |
215 | cfgDiffs = editConfiguration (cfg, option); | 220 | cfgDiffs = editConfiguration (cfg, option); |
216 | diffsFileName = | 221 | diffsFileName = |
217 | GNUNET_DISK_mktemp ("gnunet-test-configurations-diffs.conf"); | 222 | GNUNET_DISK_mktemp ("gnunet-test-configurations-diffs.conf"); |
223 | if (diffsFileName == NULL) | ||
224 | return 1; | ||
218 | GNUNET_CONFIGURATION_write_diffs (cfgDefault, cfg, diffsFileName); | 225 | GNUNET_CONFIGURATION_write_diffs (cfgDefault, cfg, diffsFileName); |
219 | GNUNET_CONFIGURATION_destroy (cfg); | 226 | GNUNET_CONFIGURATION_destroy (cfg); |
220 | 227 | ||
@@ -225,7 +232,7 @@ checkDiffs (struct GNUNET_CONFIGURATION_Handle *cfgDefault, int option) | |||
225 | cbData.callBackOption = COMPARE; | 232 | cbData.callBackOption = COMPARE; |
226 | cbData.cfgDiffs = cfgDiffs; | 233 | cbData.cfgDiffs = cfgDiffs; |
227 | GNUNET_CONFIGURATION_iterate (cfg, diffsCallBack, &cbData); | 234 | GNUNET_CONFIGURATION_iterate (cfg, diffsCallBack, &cbData); |
228 | if ((ret = cbData.status) == 1) | 235 | if (1 == (ret = cbData.status)) |
229 | { | 236 | { |
230 | fprintf (stderr, | 237 | fprintf (stderr, |
231 | "Incorrect Configuration Diffs: Diffs may contain data not actually edited\n"); | 238 | "Incorrect Configuration Diffs: Diffs may contain data not actually edited\n"); |
@@ -249,6 +256,7 @@ housekeeping: | |||
249 | #endif | 256 | #endif |
250 | GNUNET_CONFIGURATION_destroy (cfg); | 257 | GNUNET_CONFIGURATION_destroy (cfg); |
251 | GNUNET_CONFIGURATION_destroy (cfgDiffs); | 258 | GNUNET_CONFIGURATION_destroy (cfgDiffs); |
259 | GNUNET_free (diffsFileName); | ||
252 | return ret; | 260 | return ret; |
253 | } | 261 | } |
254 | 262 | ||
diff --git a/src/util/test_resolver_api.c b/src/util/test_resolver_api.c index f49d7a79a..7cef33e60 100644 --- a/src/util/test_resolver_api.c +++ b/src/util/test_resolver_api.c | |||
@@ -159,6 +159,7 @@ check () | |||
159 | { | 159 | { |
160 | int ok = 1 + 2 + 4 + 8; | 160 | int ok = 1 + 2 + 4 + 8; |
161 | char *fn; | 161 | char *fn; |
162 | char *pfx; | ||
162 | pid_t pid; | 163 | pid_t pid; |
163 | char *const argv[] = { "test-resolver-api", | 164 | char *const argv[] = { "test-resolver-api", |
164 | "-c", | 165 | "-c", |
@@ -171,9 +172,11 @@ check () | |||
171 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 172 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
172 | GNUNET_GETOPT_OPTION_END | 173 | GNUNET_GETOPT_OPTION_END |
173 | }; | 174 | }; |
175 | pfx = GNUNET_OS_installation_get_path(GNUNET_OS_IPK_BINDIR); | ||
174 | GNUNET_asprintf(&fn, "%s%cgnunet-service-resolver", | 176 | GNUNET_asprintf(&fn, "%s%cgnunet-service-resolver", |
175 | GNUNET_OS_installation_get_path(GNUNET_OS_IPK_BINDIR), | 177 | pfx, |
176 | DIR_SEPARATOR); | 178 | DIR_SEPARATOR); |
179 | GNUNET_free (pfx); | ||
177 | pid = GNUNET_OS_start_process (fn, | 180 | pid = GNUNET_OS_start_process (fn, |
178 | "gnunet-service-resolver", | 181 | "gnunet-service-resolver", |
179 | #if VERBOSE | 182 | #if VERBOSE |