Skip to content
Snippets Groups Projects
  1. Sep 19, 2014
  2. Sep 18, 2014
  3. Sep 17, 2014
  4. Sep 16, 2014
    • Peter Palfrader's avatar
      torrc.sample: Fix units · 64f65f23
      Peter Palfrader authored and Nick Mathewson's avatar Nick Mathewson committed
      64f65f23
    • Arlo Breault's avatar
      Ignore coverage_html/ · db9886b3
      Arlo Breault authored and Nick Mathewson's avatar Nick Mathewson committed
      db9886b3
    • Nick Mathewson's avatar
      feee4457
    • Nick Mathewson's avatar
      1bb10353
    • Nick Mathewson's avatar
    • Roger Dingledine's avatar
      clients now send correct address for rendezvous point · 0c3b3650
      Roger Dingledine authored and Nick Mathewson's avatar Nick Mathewson committed
      Clients now send the correct address for their chosen rendezvous point
      when trying to access a hidden service. They used to send the wrong
      address, which would still work some of the time because they also
      sent the identity digest of the rendezvous point, and if the hidden
      service happened to try connecting to the rendezvous point from a relay
      that already had a connection open to it, the relay would reuse that
      connection. Now connections to hidden services should be more robust
      and faster. Also, this bug meant that clients were leaking to the hidden
      service whether they were on a little-endian (common) or big-endian (rare)
      system, which for some users might have reduced their anonymity.
      
      Fixes bug 13151; bugfix on 0.2.1.5-alpha.
      0c3b3650
    • Nick Mathewson's avatar
      Add script to detect and remove unCish malloc-then-cast pattern · ef9a0d20
      Nick Mathewson authored
      Also, apply it.
      ef9a0d20
    • Nick Mathewson's avatar
    • Nick Mathewson's avatar
      Remove the legacy_test_helper and legacy_setup wrappers · a6627fdb
      Nick Mathewson authored
      These wrappers went into place when the default type for our unit
      test functions changed from "void fn(void)" to "void fn(void *arg)".
      
      To generate this patch, I did the same hokey-pokey as before with
      replacing all operators used as macro arguments, then I ran a
      coccinelle script, then I ran perl script to fix up everything that
      used legacy_test_helper, then I manually removed the
      legacy_test_helper functions, then I ran a final perl script to put
      the operators back how they were.
      
      ==============================
       #!/usr/bin/perl -w -i -p
      
      s/==,/_X_EQ_,/g;
      s/!=,/_X_NE_,/g;
      s/<,/_X_LT_,/g;
      s/>,/_X_GT_,/g;
      s/>=,/_X_GEQ_,/g;
      s/<=,/_X_LEQ_,/g;
      
      --------------------
      
      @@
      identifier func =~ "test_.*$";
      statement S, S2;
      @@
       static void func (
      -void
      +void *arg
       )
       {
       ... when != S2
      +(void) arg;
       S
       ...
       }
      
      --------------------
       #!/usr/bin/perl -w -i -p
      
      s/, *legacy_test_helper, *([^,]+), *\&legacy_setup, *([^\}]+) *}/, $2, $1, NULL, NULL }/g;
      
      --------------------
       #!/usr/bin/perl -w -i -p
      
      s/_X_NEQ_/!=/g;
      s/_X_NE_/!=/g;
      s/_X_EQ_/==/g;
      s/_X_GT_/>/g;
      s/_X_LT_/</g;
      s/_X_GEQ_/>=/g;
      s/_X_LEQ_/<=/g;
      
      --------------------
      a6627fdb
    • Nick Mathewson's avatar
      Add a changes file for 13119 · c72a94ea
      Nick Mathewson authored
      c72a94ea
    • Nick Mathewson's avatar
      Replace all uses of test_{str,}eq · d6846575
      Nick Mathewson authored
      d6846575
    • Nick Mathewson's avatar
      34bf9b36
    • Nick Mathewson's avatar
      remove two unused test_* macros · 0e0cef1d
      Nick Mathewson authored
      0e0cef1d
    • Nick Mathewson's avatar
    • Nick Mathewson's avatar
      Replace the remaining test_n?eq_ptr calls · 1146a6a1
      Nick Mathewson authored
      1146a6a1
    • Nick Mathewson's avatar
      Make not even macros use test_fail_msg. · 5253ba31
      Nick Mathewson authored
      5253ba31
    • Nick Mathewson's avatar
      Use coccinelle scripts to clean up our unit tests · 02438957
      Nick Mathewson authored
      This should get rid of most of the users of the old test_*
      functions.  Some are in macros and will need manual cleanup, though.
      
      This patch is for 13119, and was automatically generated with these
      scripts.  The perl scripts are there because coccinelle hates
      operators as macro arguments.
      
      ------------------------------
      
      s/==,/_X_EQ_,/g;
      s/!=,/_X_NE_,/g;
      s/<,/_X_LT_,/g;
      s/>,/_X_GT_,/g;
      s/>=,/_X_GEQ_,/g;
      s/<=,/_X_LEQ_,/g;
      
      ------------------------------
      @@
      expression a;
      identifier func;
      @@
       func (...) {
      <...
      -test_fail_msg
      +TT_DIE
       (
      +(
       a
      +)
       )
       ...>
       }
      
      @@
      identifier func;
      @@
       func (...) {
      <...
      -test_fail()
      +TT_DIE(("Assertion failed."))
       ...>
       }
      
      @@
      expression a;
      identifier func;
      @@
       func (...) {
      <...
      -test_assert
      +tt_assert
      	(a)
       ...>
       }
      
      @@
      expression a, b;
      identifier func;
      @@
       func (...) {
      <...
      -test_eq
      +tt_int_op
       (a,
      +_X_EQ_,
        b)
       ...>
       }
      
      @@
      expression a, b;
      identifier func;
      @@
       func (...) {
      <...
      -test_neq
      +tt_int_op
       (a,
      +_X_NEQ_,
        b)
       ...>
       }
      
      @@
      expression a, b;
      identifier func;
      @@
       func (...) {
      <...
      -test_streq
      +tt_str_op
       (a,
      +_X_EQ_,
        b)
       ...>
       }
      
      @@
      expression a, b;
      identifier func;
      @@
       func (...) {
      <...
      -test_strneq
      +tt_str_op
       (a,
      +_X_NEQ_,
        b)
       ...>
       }
      
      @@
      expression a, b;
      identifier func;
      @@
       func (...) {
      <...
      -test_eq_ptr
      +tt_ptr_op
       (a,
      +_X_EQ_,
        b)
       ...>
       }
      
      @@
      expression a, b;
      identifier func;
      @@
       func() {
      <...
      -test_neq_ptr
      +tt_ptr_op
       (a,
      +_X_NEQ_,
        b)
       ...>
       }
      
      @@
      expression a, b, len;
      identifier func;
      @@
       func (...) {
      <...
      -test_memeq
      +tt_mem_op
       (a,
      +_X_EQ_,
        b, len)
       ...>
       }
      
      @@
      expression a, b, len;
      identifier func;
      @@
       func (...) {
      <...
      -test_memneq
      +tt_mem_op
       (a,
      +_X_NEQ_,
        b, len)
       ...>
       }
      
      ------------------------------
      @@
      char a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_int_op
       (
      -a == b
      +a, _X_EQ_, b
       )
       ...>
      }
      
      @@
      int a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_int_op
       (
      -a == b
      +a, _X_EQ_, b
       )
       ...>
      }
      
      @@
      long a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_int_op
       (
      -a == b
      +a, _X_EQ_, b
       )
       ...>
      }
      
      @@
      unsigned int a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_uint_op
       (
      -a == b
      +a, _X_EQ_, b
       )
       ...>
      }
      
      @@
      unsigned long a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_uint_op
       (
      -a == b
      +a, _X_EQ_, b
       )
       ...>
      }
      
      @@
      char a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_int_op
       (
      -a != b
      +a, _X_NEQ_, b
       )
       ...>
      }
      
      @@
      int a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_int_op
       (
      -a != b
      +a, _X_NEQ_, b
       )
       ...>
      }
      
      @@
      long a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_int_op
       (
      -a != b
      +a, _X_NEQ_, b
       )
       ...>
      }
      
      @@
      unsigned int a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_uint_op
       (
      -a != b
      +a, _X_NEQ_, b
       )
       ...>
      }
      
      @@
      unsigned long a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_uint_op
       (
      -a != b
      +a, _X_NEQ_, b
       )
       ...>
      }
      
      @@
      char a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_int_op
       (
      -a >= b
      +a, _X_GEQ_, b
       )
       ...>
      }
      
      @@
      int a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_int_op
       (
      -a >= b
      +a, _X_GEQ_, b
       )
       ...>
      }
      
      @@
      long a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_int_op
       (
      -a >= b
      +a, _X_GEQ_, b
       )
       ...>
      }
      
      @@
      unsigned int a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_uint_op
       (
      -a >= b
      +a, _X_GEQ_, b
       )
       ...>
      }
      
      @@
      unsigned long a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_uint_op
       (
      -a >= b
      +a, _X_GEQ_, b
       )
       ...>
      }
      
      @@
      char a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_int_op
       (
      -a <= b
      +a, _X_LEQ_, b
       )
       ...>
      }
      
      @@
      int a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_int_op
       (
      -a <= b
      +a, _X_LEQ_, b
       )
       ...>
      }
      
      @@
      long a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_int_op
       (
      -a <= b
      +a, _X_LEQ_, b
       )
       ...>
      }
      
      @@
      unsigned int a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_uint_op
       (
      -a <= b
      +a, _X_LEQ_, b
       )
       ...>
      }
      
      @@
      unsigned long a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_uint_op
       (
      -a <= b
      +a, _X_LEQ_, b
       )
       ...>
      }
      
      @@
      char a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_int_op
       (
      -a > b
      +a, _X_GT_, b
       )
       ...>
      }
      
      @@
      int a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_int_op
       (
      -a > b
      +a, _X_GT_, b
       )
       ...>
      }
      
      @@
      long a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_int_op
       (
      -a > b
      +a, _X_GT_, b
       )
       ...>
      }
      
      @@
      unsigned int a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_uint_op
       (
      -a > b
      +a, _X_GT_, b
       )
       ...>
      }
      
      @@
      unsigned long a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_uint_op
       (
      -a > b
      +a, _X_GT_, b
       )
       ...>
      }
      
      @@
      char a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_int_op
       (
      -a < b
      +a, _X_LT_, b
       )
       ...>
      }
      
      @@
      int a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_int_op
       (
      -a < b
      +a, _X_LT_, b
       )
       ...>
      }
      
      @@
      long a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_int_op
       (
      -a < b
      +a, _X_LT_, b
       )
       ...>
      }
      
      @@
      unsigned int a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_uint_op
       (
      -a < b
      +a, _X_LT_, b
       )
       ...>
      }
      
      @@
      unsigned long a, b;
      identifier func;
      @@
       func (...) {
      <...
      -tt_assert
      +tt_uint_op
       (
      -a < b
      +a, _X_LT_, b
       )
       ...>
      }
      
      ------------------------------
      
      s/_X_NEQ_/!=/g;
      s/_X_NE_/!=/g;
      s/_X_EQ_/==/g;
      s/_X_GT_/>/g;
      s/_X_LT_/</g;
      s/_X_GEQ_/>=/g;
      s/_X_LEQ_/<=/g;
      
      s/test_mem_op\(/tt_mem_op\(/g;
      02438957
  5. Sep 15, 2014
  6. Sep 13, 2014
  7. Sep 12, 2014
  8. Sep 11, 2014
Loading