Replace remaining uses of deprecated test_mem* functions

This commit is contained in:
Nick Mathewson 2014-09-15 21:27:23 -04:00
parent 1146a6a1c5
commit 0d654d2355
2 changed files with 2 additions and 8 deletions

View File

@ -29,12 +29,6 @@
#define test_streq(expr1, expr2) tt_str_op((expr1), ==, (expr2)) #define test_streq(expr1, expr2) tt_str_op((expr1), ==, (expr2))
#define test_strneq(expr1, expr2) tt_str_op((expr1), !=, (expr2)) #define test_strneq(expr1, expr2) tt_str_op((expr1), !=, (expr2))
#define test_mem_op(expr1, op, expr2, len) \
tt_mem_op((expr1), op, (expr2), (len))
#define test_memeq(expr1, expr2, len) test_mem_op((expr1), ==, (expr2), len)
#define test_memneq(expr1, expr2, len) test_mem_op((expr1), !=, (expr2), len)
/* As test_mem_op, but decodes 'hex' before comparing. There must be a /* As test_mem_op, but decodes 'hex' before comparing. There must be a
* local char* variable called mem_op_hex_tmp for this to work. */ * local char* variable called mem_op_hex_tmp for this to work. */
#define test_mem_op_hex(expr1, op, hex) \ #define test_mem_op_hex(expr1, op, hex) \
@ -44,7 +38,7 @@
mem_op_hex_tmp = tor_malloc(length/2); \ mem_op_hex_tmp = tor_malloc(length/2); \
tor_assert((length&1)==0); \ tor_assert((length&1)==0); \
base16_decode(mem_op_hex_tmp, length/2, hex, length); \ base16_decode(mem_op_hex_tmp, length/2, hex, length); \
test_mem_op(expr1, op, mem_op_hex_tmp, length/2); \ tt_mem_op(expr1, op, mem_op_hex_tmp, length/2); \
STMT_END STMT_END
#define test_memeq_hex(expr1, hex) test_mem_op_hex(expr1, ==, hex) #define test_memeq_hex(expr1, hex) test_mem_op_hex(expr1, ==, hex)

View File

@ -406,7 +406,7 @@ handshake_start(or_connection_t *conn, int receiving)
tt_int_op(buf_datalen(TO_CONN(conn)->outbuf), ==, (n)); \ tt_int_op(buf_datalen(TO_CONN(conn)->outbuf), ==, (n)); \
if ((n)) { \ if ((n)) { \
fetch_from_buf(b, (n), TO_CONN(conn)->outbuf); \ fetch_from_buf(b, (n), TO_CONN(conn)->outbuf); \
test_memeq(b, (s), (n)); \ tt_mem_op(b, ==, (s), (n)); \
} \ } \
} while (0) } while (0)