summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-03-09 11:14:03 -0400
committerNick Mathewson <nickm@torproject.org>2015-03-09 11:14:03 -0400
commit0ec135b6965b4b02de7dd6f695293df6e179a4a8 (patch)
tree9893bbcac2bd1e397db57fcd8a6e453d16c42031
parentbd80ba9a9fd8309dc97e812e6e889dc3ad622b86 (diff)
parent42d877f0847f5541108328c52fb671740b888a18 (diff)
downloadtor-0ec135b6965b4b02de7dd6f695293df6e179a4a8.tar.gz
tor-0ec135b6965b4b02de7dd6f695293df6e179a4a8.zip
Merge remote-tracking branch 'origin/maint-0.2.6'
-rw-r--r--changes/151883
-rw-r--r--src/test/testing_common.c7
2 files changed, 8 insertions, 2 deletions
diff --git a/changes/15188 b/changes/15188
new file mode 100644
index 0000000000..2065b3974c
--- /dev/null
+++ b/changes/15188
@@ -0,0 +1,3 @@
+ o Minor bugfixes (testing):
+ - Avoid a side-effect in a tor_assert() in the unit tests. Fixes bug
+ 15188; bugfix on 0.1.2.3-alpha. Patch from Tom van der Woerdt.
diff --git a/src/test/testing_common.c b/src/test/testing_common.c
index d7d6dacee6..403c83bdd2 100644
--- a/src/test/testing_common.c
+++ b/src/test/testing_common.c
@@ -165,18 +165,21 @@ static crypto_pk_t *pregen_keys[5] = {NULL, NULL, NULL, NULL, NULL};
crypto_pk_t *
pk_generate(int idx)
{
+ int res;
#ifdef CACHE_GENERATED_KEYS
tor_assert(idx < N_PREGEN_KEYS);
if (! pregen_keys[idx]) {
pregen_keys[idx] = crypto_pk_new();
- tor_assert(!crypto_pk_generate_key(pregen_keys[idx]));
+ res = crypto_pk_generate_key(pregen_keys[idx]);
+ tor_assert(!res);
}
return crypto_pk_dup_key(pregen_keys[idx]);
#else
crypto_pk_t *result;
(void) idx;
result = crypto_pk_new();
- tor_assert(!crypto_pk_generate_key(result));
+ res = crypto_pk_generate_key(result);
+ tor_assert(!res);
return result;
#endif
}