mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Merge branch 'rl1987_bug26196_rebased_034' into maint-0.3.4
This commit is contained in:
commit
38cb638c32
7
changes/bug26196
Normal file
7
changes/bug26196
Normal file
@ -0,0 +1,7 @@
|
||||
o Minor bugfixes (testing, compilation):
|
||||
- Refrain from trying to get an item from empty smartlist in
|
||||
test_bridges_clear_bridge_list. Set DEBUG_SMARTLIST in unit
|
||||
tests to catch improper smartlist usage. Furthermore,
|
||||
enable DEBUG_SMARTLIST globally when build is configured
|
||||
with fragile hardening. Fixes bug 26196; bugfix on
|
||||
0.3.4.1-alpha.
|
@ -176,6 +176,7 @@ AC_ARG_ENABLE(fragile-hardening,
|
||||
AS_HELP_STRING(--enable-fragile-hardening, [enable more fragile and expensive compiler hardening; makes Tor slower]))
|
||||
if test "x$enable_expensive_hardening" = "xyes" || test "x$enable_fragile_hardening" = "xyes"; then
|
||||
fragile_hardening="yes"
|
||||
AC_DEFINE(DEBUG_SMARTLIST, 1, [Enable smartlist debugging])
|
||||
fi
|
||||
|
||||
dnl Linker hardening options
|
||||
|
@ -11,6 +11,8 @@
|
||||
* \brief Macros and functions used by unit tests.
|
||||
*/
|
||||
|
||||
#define DEBUG_SMARTLIST 1
|
||||
|
||||
#include "compat.h"
|
||||
#include "tinytest.h"
|
||||
#define TT_EXIT_TEST_FUNCTION STMT_BEGIN goto done; STMT_END
|
||||
|
@ -140,7 +140,6 @@ test_bridges_clear_bridge_list(void *arg)
|
||||
const smartlist_t *bridgelist;
|
||||
const smartlist_t *bridgelist_after;
|
||||
const bridge_info_t *bridge;
|
||||
const bridge_info_t *bridge_after;
|
||||
|
||||
helper_add_bridges_to_bridgelist(arg);
|
||||
bridgelist = bridge_list_get();
|
||||
@ -152,10 +151,7 @@ test_bridges_clear_bridge_list(void *arg)
|
||||
clear_bridge_list();
|
||||
bridgelist_after = bridge_list_get();
|
||||
tt_ptr_op(bridgelist_after, OP_NE, NULL);
|
||||
|
||||
bridge_after = smartlist_get(bridgelist, 0);
|
||||
// There now shouldn't be a first bridge
|
||||
tt_ptr_op(bridge_after, OP_EQ, NULL);
|
||||
tt_int_op(smartlist_len(bridgelist_after), OP_EQ, 0);
|
||||
|
||||
done:
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user