[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Make options_get_datadir_fname2_suffix() mockable
commit 2a17b93cc45e62c589de4f413ab0314f9bf72193
Author: Andrea Shepard <andrea@xxxxxxxxxxxxxx>
Date: Sat Jun 25 08:31:45 2016 +0000
Make options_get_datadir_fname2_suffix() mockable
---
src/or/config.c | 8 ++++----
src/or/config.h | 8 +++++---
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/src/or/config.c b/src/or/config.c
index b00f8a9..18ee979 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -7229,10 +7229,10 @@ init_libevent(const or_options_t *options)
*
* Note: Consider using the get_datadir_fname* macros in or.h.
*/
-char *
-options_get_datadir_fname2_suffix(const or_options_t *options,
- const char *sub1, const char *sub2,
- const char *suffix)
+MOCK_IMPL(char *,
+options_get_datadir_fname2_suffix,(const or_options_t *options,
+ const char *sub1, const char *sub2,
+ const char *suffix))
{
char *fname = NULL;
size_t len;
diff --git a/src/or/config.h b/src/or/config.h
index e08ad81..a0fe6e4 100644
--- a/src/or/config.h
+++ b/src/or/config.h
@@ -53,9 +53,11 @@ config_line_t *option_get_assignment(const or_options_t *options,
const char *key);
int options_save_current(void);
const char *get_torrc_fname(int defaults_fname);
-char *options_get_datadir_fname2_suffix(const or_options_t *options,
- const char *sub1, const char *sub2,
- const char *suffix);
+MOCK_DECL(char *,
+ options_get_datadir_fname2_suffix,
+ (const or_options_t *options,
+ const char *sub1, const char *sub2,
+ const char *suffix));
#define get_datadir_fname2_suffix(sub1, sub2, suffix) \
options_get_datadir_fname2_suffix(get_options(), (sub1), (sub2), (suffix))
/** Return a newly allocated string containing datadir/sub1. See
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits