summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-10-24 20:16:10 -0400
committerNick Mathewson <nickm@torproject.org>2019-10-24 20:38:02 -0400
commit4d53bbeafb70735690058ccc8acfb81366e7f579 (patch)
tree535b63a384dd7abd245386878b31a99c22d90c56 /src
parentf796bf3aa5f42451db9a7b8be10e97cb17b2f54c (diff)
downloadtor-4d53bbeafb70735690058ccc8acfb81366e7f579.tar.gz
tor-4d53bbeafb70735690058ccc8acfb81366e7f579.zip
config: make options_act*() mockable.
I'll need this for testing options_trial_assign().
Diffstat (limited to 'src')
-rw-r--r--src/app/config/config.c10
-rw-r--r--src/app/config/config.h4
2 files changed, 8 insertions, 6 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c
index 1041b6b6a3..b6927b8b77 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -822,7 +822,7 @@ static const config_deprecation_t option_deprecation_notes_[] = {
#ifdef _WIN32
static char *get_windows_conf_root(void);
#endif
-static int options_act_reversible(const or_options_t *old_options, char **msg);
+
static int options_check_transition_cb(const void *old,
const void *new,
char **msg);
@@ -1428,8 +1428,8 @@ static int have_low_ports = -1;
*
* Return 0 if all goes well, return -1 if things went badly.
*/
-static int
-options_act_reversible(const or_options_t *old_options, char **msg)
+MOCK_IMPL(STATIC int,
+options_act_reversible,(const or_options_t *old_options, char **msg))
{
smartlist_t *new_listeners = smartlist_new();
or_options_t *options = get_options_mutable();
@@ -1857,8 +1857,8 @@ options_transition_affects_dirauth_timing(const or_options_t *old_options,
* Note: We haven't moved all the "act on new configuration" logic
* here yet. Some is still in do_hup() and other places.
*/
-STATIC int
-options_act(const or_options_t *old_options)
+MOCK_IMPL(STATIC int,
+options_act,(const or_options_t *old_options))
{
config_line_t *cl;
or_options_t *options = get_options_mutable();
diff --git a/src/app/config/config.h b/src/app/config/config.h
index 2badc1af99..9cc77e2c69 100644
--- a/src/app/config/config.h
+++ b/src/app/config/config.h
@@ -264,7 +264,9 @@ int options_any_client_port_set(const or_options_t *options);
#define CL_PORT_IS_UNIXSOCKET (1u<<6)
#define CL_PORT_DFLT_GROUP_WRITABLE (1u<<7)
-STATIC int options_act(const or_options_t *old_options);
+MOCK_DECL(STATIC int, options_act,(const or_options_t *old_options));
+MOCK_DECL(STATIC int, options_act_reversible,(const or_options_t *old_options,
+ char **msg));
struct config_mgr_t;
STATIC const struct config_mgr_t *get_options_mgr(void);