aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_confparse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-07-25 09:43:50 -0400
committerNick Mathewson <nickm@torproject.org>2019-10-24 20:30:32 -0400
commit27dbf20bf477d3793d295b376713f71bccc7acaf (patch)
tree417cc6f1e82e7daf4df3702c9675121397ff9ef2 /src/test/test_confparse.c
parent68e1ced607eaed3105b4b3967e2f6af5070da0e4 (diff)
downloadtor-27dbf20bf477d3793d295b376713f71bccc7acaf.tar.gz
tor-27dbf20bf477d3793d295b376713f71bccc7acaf.zip
Use named-member syntax for initializing config_format_t objects
I'm about to mess with their lists of callbacks, and I don't want to proliferate lists where we say "NULL, NULL, NULL, ..."
Diffstat (limited to 'src/test/test_confparse.c')
-rw-r--r--src/test/test_confparse.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/test/test_confparse.c b/src/test/test_confparse.c
index 6702f34391..8cda96ba57 100644
--- a/src/test/test_confparse.c
+++ b/src/test/test_confparse.c
@@ -119,19 +119,17 @@ test_validate_cb(const void *old_options, void *options, char **msg)
#define TEST_MAGIC 0x1337
static const config_format_t test_fmt = {
- sizeof(test_struct_t),
- {
+ .size = sizeof(test_struct_t),
+ .magic = {
"test_struct_t",
TEST_MAGIC,
offsetof(test_struct_t, magic),
},
- test_abbrevs,
- test_deprecation_notes,
- test_vars,
- test_validate_cb,
- NULL,
- NULL,
- -1,
+ .abbrevs = test_abbrevs,
+ .deprecations = test_deprecation_notes,
+ .vars = test_vars,
+ .validate_fn = test_validate_cb,
+ .config_suite_offset = -1,
};
/* Make sure that config_init sets everything to the right defaults. */
@@ -815,19 +813,18 @@ static struct_member_t extra = {
};
static config_format_t etest_fmt = {
- sizeof(test_struct_t),
- {
+ .size = sizeof(test_struct_t),
+ .magic = {
"test_struct_t (with extra lines)",
ETEST_MAGIC,
offsetof(test_struct_t, magic),
},
- test_abbrevs,
- test_deprecation_notes,
- test_vars,
- test_validate_cb,
- NULL,
- &extra,
- -1,
+ .abbrevs = test_abbrevs,
+ .deprecations = test_deprecation_notes,
+ .vars = test_vars,
+ .validate_fn = test_validate_cb,
+ .extra = &extra,
+ .config_suite_offset = -1,
};
/* Try out the feature where we can store unrecognized lines and dump them