Ticket #17646: 0001-Initialize-libevent-before-periodic-events.patch

File 0001-Initialize-libevent-before-periodic-events.patch, 1.1 KB (added by cypherpunks, 4 years ago)
  • src/test/test.c

    From f2786e9d2c0f8495f9e73518e16d239d5125170b Mon Sep 17 00:00:00 2001
    From: cypherpunks <cypherpunks@torproject.org>
    Date: Wed, 25 Nov 2015 15:20:07 +0100
    Subject: [PATCH] Initialize libevent before periodic events
    
    The initialization of libevent interferes with other tests so we also
    fork the circuit_timeout test.
    ---
     src/test/test.c | 7 ++++++-
     1 file changed, 6 insertions(+), 1 deletion(-)
    
    diff --git a/src/test/test.c b/src/test/test.c
    index 0bc6292..1c4c292 100644
    a b test_circuit_timeout(void *arg) 
    319319  int i, runs;
    320320  double close_ms;
    321321  (void)arg;
     322  tor_libevent_cfg cfg;
     323
     324  memset(&cfg, 0, sizeof(cfg));
     325
     326  tor_libevent_initialize(&cfg);
    322327  initialize_periodic_events();
    323328
    324329  circuit_build_times_init(&initial);
    static struct testcase_t test_array[] = { 
    11141119  { "bad_onion_handshake", test_bad_onion_handshake, 0, NULL, NULL },
    11151120  ENT(onion_queues),
    11161121  { "ntor_handshake", test_ntor_handshake, 0, NULL, NULL },
    1117   ENT(circuit_timeout),
     1122  FORK(circuit_timeout),
    11181123  FORK(rend_fns),
    11191124  ENT(geoip),
    11201125  FORK(geoip_with_pt),