aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_configuration.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
commit5746309cb4be2073d550ad7a6885e918631dbc38 (patch)
tree89455bc4aadf977816b38df13f990372cd81d71a /src/util/test_configuration.c
parent6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff)
downloadgnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz
gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip
indentation
Diffstat (limited to 'src/util/test_configuration.c')
-rw-r--r--src/util/test_configuration.c70
1 files changed, 32 insertions, 38 deletions
diff --git a/src/util/test_configuration.c b/src/util/test_configuration.c
index 8bad5b5d4..2737cb4f7 100644
--- a/src/util/test_configuration.c
+++ b/src/util/test_configuration.c
@@ -75,8 +75,8 @@ initDiffsCBData (struct DiffsCBData *cbData)
75 * and comparing configuration 75 * and comparing configuration
76*/ 76*/
77static void 77static void
78diffsCallBack (void *cls, 78diffsCallBack (void *cls, const char *section, const char *option,
79 const char *section, const char *option, const char *value) 79 const char *value)
80{ 80{
81 struct DiffsCBData *cbData = cls; 81 struct DiffsCBData *cbData = cls;
82 int cbOption = cbData->callBackOption; 82 int cbOption = cbData->callBackOption;
@@ -90,15 +90,15 @@ diffsCallBack (void *cls,
90 { 90 {
91 GNUNET_CONFIGURATION_set_value_string (cbData->cfg, section, option, 91 GNUNET_CONFIGURATION_set_value_string (cbData->cfg, section, option,
92 "new-value"); 92 "new-value");
93 GNUNET_CONFIGURATION_set_value_string (cbData->cfgDiffs, section, 93 GNUNET_CONFIGURATION_set_value_string (cbData->cfgDiffs, section, option,
94 option, "new-value"); 94 "new-value");
95 } 95 }
96 break; 96 break;
97 case EDIT_ALL: 97 case EDIT_ALL:
98 GNUNET_CONFIGURATION_set_value_string (cbData->cfg, section, option, 98 GNUNET_CONFIGURATION_set_value_string (cbData->cfg, section, option,
99 "new-value"); 99 "new-value");
100 GNUNET_CONFIGURATION_set_value_string (cbData->cfgDiffs, section, 100 GNUNET_CONFIGURATION_set_value_string (cbData->cfgDiffs, section, option,
101 option, "new-value"); 101 "new-value");
102 break; 102 break;
103 case ADD_NEW_ENTRY: 103 case ADD_NEW_ENTRY:
104 { 104 {
@@ -107,8 +107,8 @@ diffsCallBack (void *cls,
107 if (hit == 0) 107 if (hit == 0)
108 { 108 {
109 hit = 1; 109 hit = 1;
110 GNUNET_CONFIGURATION_set_value_string (cbData->cfg, section, 110 GNUNET_CONFIGURATION_set_value_string (cbData->cfg, section, "new-key",
111 "new-key", "new-value"); 111 "new-value");
112 GNUNET_CONFIGURATION_set_value_string (cbData->cfgDiffs, section, 112 GNUNET_CONFIGURATION_set_value_string (cbData->cfgDiffs, section,
113 "new-key", "new-value"); 113 "new-key", "new-value");
114 } 114 }
@@ -183,8 +183,8 @@ editConfiguration (struct GNUNET_CONFIGURATION_Handle *cfg, int option)
183 GNUNET_asprintf (&key, "key%d", i); 183 GNUNET_asprintf (&key, "key%d", i);
184 GNUNET_CONFIGURATION_set_value_string (cfg, "new-section", key, 184 GNUNET_CONFIGURATION_set_value_string (cfg, "new-section", key,
185 "new-value"); 185 "new-value");
186 GNUNET_CONFIGURATION_set_value_string (diffsCB.cfgDiffs, 186 GNUNET_CONFIGURATION_set_value_string (diffsCB.cfgDiffs, "new-section",
187 "new-section", key, "new-value"); 187 key, "new-value");
188 GNUNET_free (key); 188 GNUNET_free (key);
189 } 189 }
190 break; 190 break;
@@ -282,8 +282,8 @@ testConfig ()
282 return 2; 282 return 2;
283 } 283 }
284 GNUNET_free (c); 284 GNUNET_free (c);
285 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (cfg, 285 if (GNUNET_OK !=
286 "test", "five", &l)) 286 GNUNET_CONFIGURATION_get_value_number (cfg, "test", "five", &l))
287 { 287 {
288 GNUNET_break (0); 288 GNUNET_break (0);
289 return 3; 289 return 3;
@@ -364,9 +364,9 @@ testConfigFilenames ()
364 int idx; 364 int idx;
365 365
366 idx = 0; 366 idx = 0;
367 if (3 != GNUNET_CONFIGURATION_iterate_value_filenames (cfg, 367 if (3 !=
368 "FILENAMES", 368 GNUNET_CONFIGURATION_iterate_value_filenames (cfg, "FILENAMES", "test",
369 "test", &check, &idx)) 369 &check, &idx))
370 { 370 {
371 GNUNET_break (0); 371 GNUNET_break (0);
372 return 8; 372 return 8;
@@ -374,60 +374,54 @@ testConfigFilenames ()
374 if (idx != 3) 374 if (idx != 3)
375 return 16; 375 return 16;
376 if (GNUNET_OK != 376 if (GNUNET_OK !=
377 GNUNET_CONFIGURATION_remove_value_filename (cfg, 377 GNUNET_CONFIGURATION_remove_value_filename (cfg, "FILENAMES", "test",
378 "FILENAMES", 378 "/File Name"))
379 "test", "/File Name"))
380 { 379 {
381 GNUNET_break (0); 380 GNUNET_break (0);
382 return 24; 381 return 24;
383 } 382 }
384 383
385 if (GNUNET_NO != 384 if (GNUNET_NO !=
386 GNUNET_CONFIGURATION_remove_value_filename (cfg, 385 GNUNET_CONFIGURATION_remove_value_filename (cfg, "FILENAMES", "test",
387 "FILENAMES", 386 "/File Name"))
388 "test", "/File Name"))
389 { 387 {
390 GNUNET_break (0); 388 GNUNET_break (0);
391 return 32; 389 return 32;
392 } 390 }
393 if (GNUNET_NO != 391 if (GNUNET_NO !=
394 GNUNET_CONFIGURATION_remove_value_filename (cfg, 392 GNUNET_CONFIGURATION_remove_value_filename (cfg, "FILENAMES", "test",
395 "FILENAMES", "test", "Stuff")) 393 "Stuff"))
396 { 394 {
397 GNUNET_break (0); 395 GNUNET_break (0);
398 return 40; 396 return 40;
399 } 397 }
400 398
401 if (GNUNET_NO != 399 if (GNUNET_NO !=
402 GNUNET_CONFIGURATION_append_value_filename (cfg, 400 GNUNET_CONFIGURATION_append_value_filename (cfg, "FILENAMES", "test",
403 "FILENAMES", 401 "/Hello"))
404 "test", "/Hello"))
405 { 402 {
406 GNUNET_break (0); 403 GNUNET_break (0);
407 return 48; 404 return 48;
408 } 405 }
409 if (GNUNET_NO != 406 if (GNUNET_NO !=
410 GNUNET_CONFIGURATION_append_value_filename (cfg, 407 GNUNET_CONFIGURATION_append_value_filename (cfg, "FILENAMES", "test",
411 "FILENAMES", 408 "/World"))
412 "test", "/World"))
413 { 409 {
414 GNUNET_break (0); 410 GNUNET_break (0);
415 return 56; 411 return 56;
416 } 412 }
417 413
418 if (GNUNET_YES != 414 if (GNUNET_YES !=
419 GNUNET_CONFIGURATION_append_value_filename (cfg, 415 GNUNET_CONFIGURATION_append_value_filename (cfg, "FILENAMES", "test",
420 "FILENAMES", 416 "/File 1"))
421 "test", "/File 1"))
422 { 417 {
423 GNUNET_break (0); 418 GNUNET_break (0);
424 return 64; 419 return 64;
425 } 420 }
426 421
427 if (GNUNET_YES != 422 if (GNUNET_YES !=
428 GNUNET_CONFIGURATION_append_value_filename (cfg, 423 GNUNET_CONFIGURATION_append_value_filename (cfg, "FILENAMES", "test",
429 "FILENAMES", 424 "/File 2"))
430 "test", "/File 2"))
431 { 425 {
432 GNUNET_break (0); 426 GNUNET_break (0);
433 return 72; 427 return 72;
@@ -437,9 +431,9 @@ testConfigFilenames ()
437 want[1] = "/World"; 431 want[1] = "/World";
438 want[2] = "/File 1"; 432 want[2] = "/File 1";
439 want[3] = "/File 2"; 433 want[3] = "/File 2";
440 if (4 != GNUNET_CONFIGURATION_iterate_value_filenames (cfg, 434 if (4 !=
441 "FILENAMES", 435 GNUNET_CONFIGURATION_iterate_value_filenames (cfg, "FILENAMES", "test",
442 "test", &check, &idx)) 436 &check, &idx))
443 { 437 {
444 GNUNET_break (0); 438 GNUNET_break (0);
445 return 80; 439 return 80;