commit 17a870a64b300071144f8814ff4179aa58882387 Merge: f5fa283a0 c281fa0da Author: Nick Mathewson nickm@torproject.org Date: Wed Sep 4 08:41:42 2019 -0400
Merge branch 'ticket31240v2_merged_2' into ticket31240v2_merged_2_merged
src/app/config/config.c | 157 +++---- src/app/config/config.h | 5 +- src/app/config/confparse.c | 746 +++++++++++++++++++++++------- src/app/config/confparse.h | 86 ++-- src/app/config/or_options_st.h | 9 + src/app/config/or_state_st.h | 9 + src/app/config/statefile.c | 43 +- src/feature/dirauth/shared_random_state.c | 43 +- src/test/fuzz/fuzzing_common.c | 5 +- src/test/include.am | 1 + src/test/test.c | 1 + src/test/test.h | 1 + src/test/test_config.c | 92 ++-- src/test/test_confmgr.c | 325 +++++++++++++ src/test/test_confparse.c | 381 ++++++++++----- src/test/test_dir_handle_get.c | 3 +- src/test/test_entrynodes.c | 30 +- src/test/test_helpers.c | 2 +- src/test/test_hs_service.c | 10 +- src/test/test_options.c | 14 +- src/test/test_pt.c | 2 +- 21 files changed, 1477 insertions(+), 488 deletions(-)
diff --cc src/test/test_confparse.c index 4df275fc3,f04c412c0..cf2e8a80e --- a/src/test/test_confparse.c +++ b/src/test/test_confparse.c @@@ -584,20 -599,19 +599,23 @@@ static voi test_confparse_reset(void *arg) { (void)arg; - test_struct_t *tst = get_simple_config(); + config_mgr_t *mgr = config_mgr_new(&test_fmt); + config_mgr_freeze(mgr); + test_struct_t *tst = get_simple_config(mgr);
- config_reset_line(&test_fmt, tst, "interval", 0); + config_reset_line(mgr, tst, "interval", 0); tt_int_op(tst->interval, OP_EQ, 0);
- config_reset_line(&test_fmt, tst, "interval", 1); + config_reset_line(mgr, tst, "interval", 1); tt_int_op(tst->interval, OP_EQ, 10);
+ tt_ptr_op(tst->routerset, OP_NE, NULL); + config_reset_line(&test_fmt, tst, "routerset", 0); + tt_ptr_op(tst->routerset, OP_EQ, NULL); + done: - config_free(&test_fmt, tst); + config_free(mgr, tst); + config_mgr_free(mgr); }
/* Try setting options a second time on a config object, and make sure
tor-commits@lists.torproject.org