aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_options.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-10-26 18:05:58 -0400
committerNick Mathewson <nickm@torproject.org>2019-11-07 07:28:43 -0500
commit8cd3e66d93a7b3f61afc3bc0c8868fb50c85af22 (patch)
tree03f567e7ba8d2fb328d6d07dd0c8453036f5f3a6 /src/test/test_options.c
parentb06e9d8ad58bfe11d2c1f6a921ba059658a578f2 (diff)
downloadtor-8cd3e66d93a7b3f61afc3bc0c8868fb50c85af22.tar.gz
tor-8cd3e66d93a7b3f61afc3bc0c8868fb50c85af22.zip
Use new configuration architecture for crypto options
This is a comparatively simple change.
Diffstat (limited to 'src/test/test_options.c')
-rw-r--r--src/test/test_options.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/test/test_options.c b/src/test/test_options.c
index c06fb998fb..6a933bec4f 100644
--- a/src/test/test_options.c
+++ b/src/test/test_options.c
@@ -17,8 +17,11 @@
#define ROUTERSET_PRIVATE
#include "feature/nodelist/routerset.h"
#include "core/mainloop/mainloop.h"
+#include "app/main/subsysmgr.h"
#include "test/log_test_helpers.h"
#include "test/resolve_test_helpers.h"
+#include "lib/crypt_ops/crypto_options_st.h"
+#include "lib/crypt_ops/crypto_sys.h"
#include "lib/sandbox/sandbox.h"
#include "lib/memarea/memarea.h"
@@ -3985,6 +3988,14 @@ test_options_validate__testing_options(void *ignored)
tor_free(msg);
}
+static crypto_options_t *
+get_crypto_options(or_options_t *opt)
+{
+ int idx = subsystems_get_options_idx(&sys_crypto);
+ tor_assert(idx >= 0);
+ return config_mgr_get_obj_mutable(get_options_mgr(), opt, idx);
+}
+
static void
test_options_validate__accel(void *ignored)
{
@@ -3997,15 +4008,15 @@ test_options_validate__accel(void *ignored)
tdata = get_options_test_data("AccelName foo\n");
ret = options_validate(NULL, tdata->opt, &msg);
tt_int_op(ret, OP_EQ, 0);
- tt_int_op(tdata->opt->HardwareAccel, OP_EQ, 1);
+ tt_int_op(get_crypto_options(tdata->opt)->HardwareAccel, OP_EQ, 1);
tor_free(msg);
free_options_test_data(tdata);
tdata = get_options_test_data("AccelName foo\n");
- tdata->opt->HardwareAccel = 2;
+ get_crypto_options(tdata->opt)->HardwareAccel = 2;
ret = options_validate(NULL, tdata->opt, &msg);
tt_int_op(ret, OP_EQ, 0);
- tt_int_op(tdata->opt->HardwareAccel, OP_EQ, 2);
+ tt_int_op(get_crypto_options(tdata->opt)->HardwareAccel, OP_EQ, 2);
tor_free(msg);
free_options_test_data(tdata);