aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_socks.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-11-12 13:28:07 -0500
committerNick Mathewson <nickm@torproject.org>2014-11-12 13:28:07 -0500
commita3dafd3f58bb3122b9de919e931c02b5e12373b2 (patch)
tree3df98129cf51f089d4edb734f55ea86f5b8e8e74 /src/test/test_socks.c
parent2170171d84e30bc4b1b2565255bd978668c50e97 (diff)
downloadtor-a3dafd3f58bb3122b9de919e931c02b5e12373b2.tar.gz
tor-a3dafd3f58bb3122b9de919e931c02b5e12373b2.zip
Replace operators used as macro arguments with OP_XX macros
Part of fix for 13172
Diffstat (limited to 'src/test/test_socks.c')
-rw-r--r--src/test/test_socks.c302
1 files changed, 151 insertions, 151 deletions
diff --git a/src/test/test_socks.c b/src/test/test_socks.c
index 29faa69fb8..98c5be0119 100644
--- a/src/test/test_socks.c
+++ b/src/test/test_socks.c
@@ -63,8 +63,8 @@ test_socks_4_unsupported_commands(void *ptr)
ADD_DATA(buf, "\x04\x02\x11\x11\x02\x02\x02\x02\x00");
tt_assert(fetch_from_buf_socks(buf, socks, get_options()->TestSocks,
get_options()->SafeSocks) == -1);
- tt_int_op(4,==, socks->socks_version);
- tt_int_op(0,==, socks->replylen); /* XXX: shouldn't tor reply? */
+ tt_int_op(4,OP_EQ, socks->socks_version);
+ tt_int_op(0,OP_EQ, socks->replylen); /* XXX: shouldn't tor reply? */
done:
;
@@ -76,49 +76,49 @@ test_socks_4_supported_commands(void *ptr)
{
SOCKS_TEST_INIT();
- tt_int_op(0,==, buf_datalen(buf));
+ tt_int_op(0,OP_EQ, buf_datalen(buf));
/* SOCKS 4 Send CONNECT [01] to IP address 2.2.2.2:4370 */
ADD_DATA(buf, "\x04\x01\x11\x12\x02\x02\x02\x03\x00");
tt_assert(fetch_from_buf_socks(buf, socks, get_options()->TestSocks,
get_options()->SafeSocks) == 1);
- tt_int_op(4,==, socks->socks_version);
- tt_int_op(0,==, socks->replylen); /* XXX: shouldn't tor reply? */
- tt_int_op(SOCKS_COMMAND_CONNECT,==, socks->command);
- tt_str_op("2.2.2.3",==, socks->address);
- tt_int_op(4370,==, socks->port);
+ tt_int_op(4,OP_EQ, socks->socks_version);
+ tt_int_op(0,OP_EQ, socks->replylen); /* XXX: shouldn't tor reply? */
+ tt_int_op(SOCKS_COMMAND_CONNECT,OP_EQ, socks->command);
+ tt_str_op("2.2.2.3",OP_EQ, socks->address);
+ tt_int_op(4370,OP_EQ, socks->port);
tt_assert(socks->got_auth == 0);
tt_assert(! socks->username);
- tt_int_op(0,==, buf_datalen(buf));
+ tt_int_op(0,OP_EQ, buf_datalen(buf));
socks_request_clear(socks);
/* SOCKS 4 Send CONNECT [01] to IP address 2.2.2.2:4369 with userid*/
ADD_DATA(buf, "\x04\x01\x11\x12\x02\x02\x02\x04me\x00");
tt_assert(fetch_from_buf_socks(buf, socks, get_options()->TestSocks,
get_options()->SafeSocks) == 1);
- tt_int_op(4,==, socks->socks_version);
- tt_int_op(0,==, socks->replylen); /* XXX: shouldn't tor reply? */
- tt_int_op(SOCKS_COMMAND_CONNECT,==, socks->command);
- tt_str_op("2.2.2.4",==, socks->address);
- tt_int_op(4370,==, socks->port);
+ tt_int_op(4,OP_EQ, socks->socks_version);
+ tt_int_op(0,OP_EQ, socks->replylen); /* XXX: shouldn't tor reply? */
+ tt_int_op(SOCKS_COMMAND_CONNECT,OP_EQ, socks->command);
+ tt_str_op("2.2.2.4",OP_EQ, socks->address);
+ tt_int_op(4370,OP_EQ, socks->port);
tt_assert(socks->got_auth == 1);
tt_assert(socks->username);
- tt_int_op(2,==, socks->usernamelen);
- tt_mem_op("me",==, socks->username, 2);
+ tt_int_op(2,OP_EQ, socks->usernamelen);
+ tt_mem_op("me",OP_EQ, socks->username, 2);
- tt_int_op(0,==, buf_datalen(buf));
+ tt_int_op(0,OP_EQ, buf_datalen(buf));
socks_request_clear(socks);
/* SOCKS 4a Send RESOLVE [F0] request for torproject.org */
ADD_DATA(buf, "\x04\xF0\x01\x01\x00\x00\x00\x02me\x00torproject.org\x00");
tt_assert(fetch_from_buf_socks(buf, socks, get_options()->TestSocks,
get_options()->SafeSocks) == 1);
- tt_int_op(4,==, socks->socks_version);
- tt_int_op(0,==, socks->replylen); /* XXX: shouldn't tor reply? */
- tt_str_op("torproject.org",==, socks->address);
+ tt_int_op(4,OP_EQ, socks->socks_version);
+ tt_int_op(0,OP_EQ, socks->replylen); /* XXX: shouldn't tor reply? */
+ tt_str_op("torproject.org",OP_EQ, socks->address);
- tt_int_op(0,==, buf_datalen(buf));
+ tt_int_op(0,OP_EQ, buf_datalen(buf));
done:
;
@@ -134,21 +134,21 @@ test_socks_5_unsupported_commands(void *ptr)
ADD_DATA(buf, "\x05\x02\x00\x01");
tt_int_op(fetch_from_buf_socks(buf, socks, get_options()->TestSocks,
- get_options()->SafeSocks),==, 0);
- tt_int_op(0,==, buf_datalen(buf));
- tt_int_op(5,==, socks->socks_version);
- tt_int_op(2,==, socks->replylen);
- tt_int_op(5,==, socks->reply[0]);
- tt_int_op(0,==, socks->reply[1]);
+ get_options()->SafeSocks),OP_EQ, 0);
+ tt_int_op(0,OP_EQ, buf_datalen(buf));
+ tt_int_op(5,OP_EQ, socks->socks_version);
+ tt_int_op(2,OP_EQ, socks->replylen);
+ tt_int_op(5,OP_EQ, socks->reply[0]);
+ tt_int_op(0,OP_EQ, socks->reply[1]);
ADD_DATA(buf, "\x05\x02\x00\x01\x02\x02\x02\x01\x01\x01");
tt_int_op(fetch_from_buf_socks(buf, socks, get_options()->TestSocks,
- get_options()->SafeSocks),==, -1);
+ get_options()->SafeSocks),OP_EQ, -1);
- tt_int_op(5,==,socks->socks_version);
- tt_int_op(10,==,socks->replylen);
- tt_int_op(5,==,socks->reply[0]);
- tt_int_op(SOCKS5_COMMAND_NOT_SUPPORTED,==,socks->reply[1]);
- tt_int_op(1,==,socks->reply[3]);
+ tt_int_op(5,OP_EQ,socks->socks_version);
+ tt_int_op(10,OP_EQ,socks->replylen);
+ tt_int_op(5,OP_EQ,socks->reply[0]);
+ tt_int_op(SOCKS5_COMMAND_NOT_SUPPORTED,OP_EQ,socks->reply[1]);
+ tt_int_op(1,OP_EQ,socks->reply[3]);
buf_clear(buf);
socks_request_clear(socks);
@@ -156,20 +156,20 @@ test_socks_5_unsupported_commands(void *ptr)
/* SOCKS 5 Send unsupported UDP_ASSOCIATE [03] command */
ADD_DATA(buf, "\x05\x02\x00\x01");
tt_int_op(fetch_from_buf_socks(buf, socks, get_options()->TestSocks,
- get_options()->SafeSocks),==, 0);
- tt_int_op(5,==, socks->socks_version);
- tt_int_op(2,==, socks->replylen);
- tt_int_op(5,==, socks->reply[0]);
- tt_int_op(0,==, socks->reply[1]);
+ get_options()->SafeSocks),OP_EQ, 0);
+ tt_int_op(5,OP_EQ, socks->socks_version);
+ tt_int_op(2,OP_EQ, socks->replylen);
+ tt_int_op(5,OP_EQ, socks->reply[0]);
+ tt_int_op(0,OP_EQ, socks->reply[1]);
ADD_DATA(buf, "\x05\x03\x00\x01\x02\x02\x02\x01\x01\x01");
tt_int_op(fetch_from_buf_socks(buf, socks, get_options()->TestSocks,
- get_options()->SafeSocks),==, -1);
+ get_options()->SafeSocks),OP_EQ, -1);
- tt_int_op(5,==,socks->socks_version);
- tt_int_op(10,==,socks->replylen);
- tt_int_op(5,==,socks->reply[0]);
- tt_int_op(SOCKS5_COMMAND_NOT_SUPPORTED,==,socks->reply[1]);
- tt_int_op(1,==,socks->reply[3]);
+ tt_int_op(5,OP_EQ,socks->socks_version);
+ tt_int_op(10,OP_EQ,socks->replylen);
+ tt_int_op(5,OP_EQ,socks->reply[0]);
+ tt_int_op(SOCKS5_COMMAND_NOT_SUPPORTED,OP_EQ,socks->reply[1]);
+ tt_int_op(1,OP_EQ,socks->reply[3]);
done:
;
@@ -184,35 +184,35 @@ test_socks_5_supported_commands(void *ptr)
/* SOCKS 5 Send CONNECT [01] to IP address 2.2.2.2:4369 */
ADD_DATA(buf, "\x05\x01\x00");
tt_int_op(fetch_from_buf_socks(buf, socks, get_options()->TestSocks,
- get_options()->SafeSocks),==, 0);
- tt_int_op(5,==, socks->socks_version);
- tt_int_op(2,==, socks->replylen);
- tt_int_op(5,==, socks->reply[0]);
- tt_int_op(0,==, socks->reply[1]);
+ get_options()->SafeSocks),OP_EQ, 0);
+ tt_int_op(5,OP_EQ, socks->socks_version);
+ tt_int_op(2,OP_EQ, socks->replylen);
+ tt_int_op(5,OP_EQ, socks->reply[0]);
+ tt_int_op(0,OP_EQ, socks->reply[1]);
ADD_DATA(buf, "\x05\x01\x00\x01\x02\x02\x02\x02\x11\x11");
tt_int_op(fetch_from_buf_socks(buf, socks, get_options()->TestSocks,
- get_options()->SafeSocks),==, 1);
- tt_str_op("2.2.2.2",==, socks->address);
- tt_int_op(4369,==, socks->port);
+ get_options()->SafeSocks),OP_EQ, 1);
+ tt_str_op("2.2.2.2",OP_EQ, socks->address);
+ tt_int_op(4369,OP_EQ, socks->port);
- tt_int_op(0,==, buf_datalen(buf));
+ tt_int_op(0,OP_EQ, buf_datalen(buf));
socks_request_clear(socks);
/* SOCKS 5 Send CONNECT [01] to FQDN torproject.org:4369 */
ADD_DATA(buf, "\x05\x01\x00");
ADD_DATA(buf, "\x05\x01\x00\x03\x0Etorproject.org\x11\x11");
tt_int_op(fetch_from_buf_socks(buf, socks, get_options()->TestSocks,
- get_options()->SafeSocks),==, 1);
+ get_options()->SafeSocks),OP_EQ, 1);
- tt_int_op(5,==, socks->socks_version);
- tt_int_op(2,==, socks->replylen);
- tt_int_op(5,==, socks->reply[0]);
- tt_int_op(0,==, socks->reply[1]);
- tt_str_op("torproject.org",==, socks->address);
- tt_int_op(4369,==, socks->port);
+ tt_int_op(5,OP_EQ, socks->socks_version);
+ tt_int_op(2,OP_EQ, socks->replylen);
+ tt_int_op(5,OP_EQ, socks->reply[0]);
+ tt_int_op(0,OP_EQ, socks->reply[1]);
+ tt_str_op("torproject.org",OP_EQ, socks->address);
+ tt_int_op(4369,OP_EQ, socks->port);
- tt_int_op(0,==, buf_datalen(buf));
+ tt_int_op(0,OP_EQ, buf_datalen(buf));
socks_request_clear(socks);
/* SOCKS 5 Send RESOLVE [F0] request for torproject.org:4369 */
@@ -220,13 +220,13 @@ test_socks_5_supported_commands(void *ptr)
ADD_DATA(buf, "\x05\xF0\x00\x03\x0Etorproject.org\x01\x02");
tt_assert(fetch_from_buf_socks(buf, socks, get_options()->TestSocks,
get_options()->SafeSocks) == 1);
- tt_int_op(5,==, socks->socks_version);
- tt_int_op(2,==, socks->replylen);
- tt_int_op(5,==, socks->reply[0]);
- tt_int_op(0,==, socks->reply[1]);
- tt_str_op("torproject.org",==, socks->address);
+ tt_int_op(5,OP_EQ, socks->socks_version);
+ tt_int_op(2,OP_EQ, socks->replylen);
+ tt_int_op(5,OP_EQ, socks->reply[0]);
+ tt_int_op(0,OP_EQ, socks->reply[1]);
+ tt_str_op("torproject.org",OP_EQ, socks->address);
- tt_int_op(0,==, buf_datalen(buf));
+ tt_int_op(0,OP_EQ, buf_datalen(buf));
socks_request_clear(socks);
/* SOCKS 5 Should reject RESOLVE [F0] request for IPv4 address
@@ -239,11 +239,11 @@ test_socks_5_supported_commands(void *ptr)
tt_assert(fetch_from_buf_socks(buf,socks,get_options()->TestSocks,1)
== -1);
- tt_int_op(5,==,socks->socks_version);
- tt_int_op(10,==,socks->replylen);
- tt_int_op(5,==,socks->reply[0]);
- tt_int_op(SOCKS5_NOT_ALLOWED,==,socks->reply[1]);
- tt_int_op(1,==,socks->reply[3]);
+ tt_int_op(5,OP_EQ,socks->socks_version);
+ tt_int_op(10,OP_EQ,socks->replylen);
+ tt_int_op(5,OP_EQ,socks->reply[0]);
+ tt_int_op(SOCKS5_NOT_ALLOWED,OP_EQ,socks->reply[1]);
+ tt_int_op(1,OP_EQ,socks->reply[3]);
socks_request_clear(socks);
@@ -257,11 +257,11 @@ test_socks_5_supported_commands(void *ptr)
tt_assert(fetch_from_buf_socks(buf,socks,get_options()->TestSocks,1)
== -1);
- tt_int_op(5,==,socks->socks_version);
- tt_int_op(10,==,socks->replylen);
- tt_int_op(5,==,socks->reply[0]);
- tt_int_op(SOCKS5_NOT_ALLOWED,==,socks->reply[1]);
- tt_int_op(1,==,socks->reply[3]);
+ tt_int_op(5,OP_EQ,socks->socks_version);
+ tt_int_op(10,OP_EQ,socks->replylen);
+ tt_int_op(5,OP_EQ,socks->reply[0]);
+ tt_int_op(SOCKS5_NOT_ALLOWED,OP_EQ,socks->reply[1]);
+ tt_int_op(1,OP_EQ,socks->reply[3]);
socks_request_clear(socks);
@@ -270,13 +270,13 @@ test_socks_5_supported_commands(void *ptr)
ADD_DATA(buf, "\x05\xF1\x00\x01\x02\x02\x02\x05\x01\x03");
tt_assert(fetch_from_buf_socks(buf, socks, get_options()->TestSocks,
get_options()->SafeSocks) == 1);
- tt_int_op(5,==, socks->socks_version);
- tt_int_op(2,==, socks->replylen);
- tt_int_op(5,==, socks->reply[0]);
- tt_int_op(0,==, socks->reply[1]);
- tt_str_op("2.2.2.5",==, socks->address);
+ tt_int_op(5,OP_EQ, socks->socks_version);
+ tt_int_op(2,OP_EQ, socks->replylen);
+ tt_int_op(5,OP_EQ, socks->reply[0]);
+ tt_int_op(0,OP_EQ, socks->reply[1]);
+ tt_str_op("2.2.2.5",OP_EQ, socks->address);
- tt_int_op(0,==, buf_datalen(buf));
+ tt_int_op(0,OP_EQ, buf_datalen(buf));
done:
;
@@ -293,27 +293,27 @@ test_socks_5_no_authenticate(void *ptr)
tt_assert(!fetch_from_buf_socks(buf, socks,
get_options()->TestSocks,
get_options()->SafeSocks));
- tt_int_op(2,==, socks->replylen);
- tt_int_op(5,==, socks->reply[0]);
- tt_int_op(SOCKS_NO_AUTH,==, socks->reply[1]);
+ tt_int_op(2,OP_EQ, socks->replylen);
+ tt_int_op(5,OP_EQ, socks->reply[0]);
+ tt_int_op(SOCKS_NO_AUTH,OP_EQ, socks->reply[1]);
- tt_int_op(0,==, buf_datalen(buf));
+ tt_int_op(0,OP_EQ, buf_datalen(buf));
/*SOCKS 5 Send username/password anyway - pretend to be broken */
ADD_DATA(buf,"\x01\x02\x01\x01\x02\x01\x01");
tt_assert(!fetch_from_buf_socks(buf, socks,
get_options()->TestSocks,
get_options()->SafeSocks));
- tt_int_op(5,==, socks->socks_version);
- tt_int_op(2,==, socks->replylen);
- tt_int_op(1,==, socks->reply[0]);
- tt_int_op(0,==, socks->reply[1]);
+ tt_int_op(5,OP_EQ, socks->socks_version);
+ tt_int_op(2,OP_EQ, socks->replylen);
+ tt_int_op(1,OP_EQ, socks->reply[0]);
+ tt_int_op(0,OP_EQ, socks->reply[1]);
- tt_int_op(2,==, socks->usernamelen);
- tt_int_op(2,==, socks->passwordlen);
+ tt_int_op(2,OP_EQ, socks->usernamelen);
+ tt_int_op(2,OP_EQ, socks->passwordlen);
- tt_mem_op("\x01\x01",==, socks->username, 2);
- tt_mem_op("\x01\x01",==, socks->password, 2);
+ tt_mem_op("\x01\x01",OP_EQ, socks->username, 2);
+ tt_mem_op("\x01\x01",OP_EQ, socks->password, 2);
done:
;
@@ -331,28 +331,28 @@ test_socks_5_authenticate(void *ptr)
tt_assert(!fetch_from_buf_socks(buf, socks,
get_options()->TestSocks,
get_options()->SafeSocks));
- tt_int_op(2,==, socks->replylen);
- tt_int_op(5,==, socks->reply[0]);
- tt_int_op(SOCKS_USER_PASS,==, socks->reply[1]);
- tt_int_op(5,==, socks->socks_version);
+ tt_int_op(2,OP_EQ, socks->replylen);
+ tt_int_op(5,OP_EQ, socks->reply[0]);
+ tt_int_op(SOCKS_USER_PASS,OP_EQ, socks->reply[1]);
+ tt_int_op(5,OP_EQ, socks->socks_version);
- tt_int_op(0,==, buf_datalen(buf));
+ tt_int_op(0,OP_EQ, buf_datalen(buf));
/* SOCKS 5 Send username/password */
ADD_DATA(buf, "\x01\x02me\x08mypasswd");
tt_assert(!fetch_from_buf_socks(buf, socks,
get_options()->TestSocks,
get_options()->SafeSocks));
- tt_int_op(5,==, socks->socks_version);
- tt_int_op(2,==, socks->replylen);
- tt_int_op(1,==, socks->reply[0]);
- tt_int_op(0,==, socks->reply[1]);
+ tt_int_op(5,OP_EQ, socks->socks_version);
+ tt_int_op(2,OP_EQ, socks->replylen);
+ tt_int_op(1,OP_EQ, socks->reply[0]);
+ tt_int_op(0,OP_EQ, socks->reply[1]);
- tt_int_op(2,==, socks->usernamelen);
- tt_int_op(8,==, socks->passwordlen);
+ tt_int_op(2,OP_EQ, socks->usernamelen);
+ tt_int_op(8,OP_EQ, socks->passwordlen);
- tt_mem_op("me",==, socks->username, 2);
- tt_mem_op("mypasswd",==, socks->password, 8);
+ tt_mem_op("me",OP_EQ, socks->username, 2);
+ tt_mem_op("mypasswd",OP_EQ, socks->password, 8);
done:
;
@@ -370,12 +370,12 @@ test_socks_5_authenticate_with_data(void *ptr)
tt_assert(!fetch_from_buf_socks(buf, socks,
get_options()->TestSocks,
get_options()->SafeSocks));
- tt_int_op(2,==, socks->replylen);
- tt_int_op(5,==, socks->reply[0]);
- tt_int_op(SOCKS_USER_PASS,==, socks->reply[1]);
- tt_int_op(5,==, socks->socks_version);
+ tt_int_op(2,OP_EQ, socks->replylen);
+ tt_int_op(5,OP_EQ, socks->reply[0]);
+ tt_int_op(SOCKS_USER_PASS,OP_EQ, socks->reply[1]);
+ tt_int_op(5,OP_EQ, socks->socks_version);
- tt_int_op(0,==, buf_datalen(buf));
+ tt_int_op(0,OP_EQ, buf_datalen(buf));
/* SOCKS 5 Send username/password */
/* SOCKS 5 Send CONNECT [01] to IP address 2.2.2.2:4369 */
@@ -383,18 +383,18 @@ test_socks_5_authenticate_with_data(void *ptr)
tt_assert(fetch_from_buf_socks(buf, socks,
get_options()->TestSocks,
get_options()->SafeSocks) == 1);
- tt_int_op(5,==, socks->socks_version);
- tt_int_op(2,==, socks->replylen);
- tt_int_op(1,==, socks->reply[0]);
- tt_int_op(0,==, socks->reply[1]);
+ tt_int_op(5,OP_EQ, socks->socks_version);
+ tt_int_op(2,OP_EQ, socks->replylen);
+ tt_int_op(1,OP_EQ, socks->reply[0]);
+ tt_int_op(0,OP_EQ, socks->reply[1]);
- tt_str_op("2.2.2.2",==, socks->address);
- tt_int_op(4369,==, socks->port);
+ tt_str_op("2.2.2.2",OP_EQ, socks->address);
+ tt_int_op(4369,OP_EQ, socks->port);
- tt_int_op(2,==, socks->usernamelen);
- tt_int_op(3,==, socks->passwordlen);
- tt_mem_op("me",==, socks->username, 2);
- tt_mem_op("you",==, socks->password, 3);
+ tt_int_op(2,OP_EQ, socks->usernamelen);
+ tt_int_op(3,OP_EQ, socks->passwordlen);
+ tt_mem_op("me",OP_EQ, socks->username, 2);
+ tt_mem_op("you",OP_EQ, socks->password, 3);
done:
;
@@ -411,10 +411,10 @@ test_socks_5_auth_before_negotiation(void *ptr)
tt_assert(fetch_from_buf_socks(buf, socks,
get_options()->TestSocks,
get_options()->SafeSocks) == -1);
- tt_int_op(0,==, socks->socks_version);
- tt_int_op(0,==, socks->replylen);
- tt_int_op(0,==, socks->reply[0]);
- tt_int_op(0,==, socks->reply[1]);
+ tt_int_op(0,OP_EQ, socks->socks_version);
+ tt_int_op(0,OP_EQ, socks->replylen);
+ tt_int_op(0,OP_EQ, socks->reply[0]);
+ tt_int_op(0,OP_EQ, socks->reply[1]);
done:
;
@@ -432,14 +432,14 @@ test_socks_5_malformed_commands(void *ptr)
*/
ADD_DATA(buf, "\x05\x01\x00");
ADD_DATA(buf, "\x05\x01\x00\x01\x02\x02\x02\x02\x11\x11");
- tt_int_op(fetch_from_buf_socks(buf, socks, get_options()->TestSocks, 1),==,
+ tt_int_op(fetch_from_buf_socks(buf, socks, get_options()->TestSocks, 1),OP_EQ,
-1);
- tt_int_op(5,==,socks->socks_version);
- tt_int_op(10,==,socks->replylen);
- tt_int_op(5,==,socks->reply[0]);
- tt_int_op(SOCKS5_NOT_ALLOWED,==,socks->reply[1]);
- tt_int_op(1,==,socks->reply[3]);
+ tt_int_op(5,OP_EQ,socks->socks_version);
+ tt_int_op(10,OP_EQ,socks->replylen);
+ tt_int_op(5,OP_EQ,socks->reply[0]);
+ tt_int_op(SOCKS5_NOT_ALLOWED,OP_EQ,socks->reply[1]);
+ tt_int_op(1,OP_EQ,socks->reply[3]);
buf_clear(buf);
socks_request_clear(socks);
@@ -448,13 +448,13 @@ test_socks_5_malformed_commands(void *ptr)
ADD_DATA(buf, "\x05\x01\x00");
ADD_DATA(buf, "\x05\xF1\x00\x03\x0Etorproject.org\x11\x11");
tt_int_op(fetch_from_buf_socks(buf, socks, get_options()->TestSocks,
- get_options()->SafeSocks),==, -1);
+ get_options()->SafeSocks),OP_EQ, -1);
- tt_int_op(5,==,socks->socks_version);
- tt_int_op(10,==,socks->replylen);
- tt_int_op(5,==,socks->reply[0]);
- tt_int_op(SOCKS5_ADDRESS_TYPE_NOT_SUPPORTED,==,socks->reply[1]);
- tt_int_op(1,==,socks->reply[3]);
+ tt_int_op(5,OP_EQ,socks->socks_version);
+ tt_int_op(10,OP_EQ,socks->replylen);
+ tt_int_op(5,OP_EQ,socks->reply[0]);
+ tt_int_op(SOCKS5_ADDRESS_TYPE_NOT_SUPPORTED,OP_EQ,socks->reply[1]);
+ tt_int_op(1,OP_EQ,socks->reply[3]);
buf_clear(buf);
socks_request_clear(socks);
@@ -465,13 +465,13 @@ test_socks_5_malformed_commands(void *ptr)
ADD_DATA(buf, "\x05\x01\x00");
ADD_DATA(buf, "\x05\x01\x00\x03\x09\"\"\"\"\".com\x11\x11");
tt_int_op(fetch_from_buf_socks(buf, socks, get_options()->TestSocks,
- get_options()->SafeSocks),==, -1);
+ get_options()->SafeSocks),OP_EQ, -1);
- tt_int_op(5,==,socks->socks_version);
- tt_int_op(10,==,socks->replylen);
- tt_int_op(5,==,socks->reply[0]);
- tt_int_op(SOCKS5_GENERAL_ERROR,==,socks->reply[1]);
- tt_int_op(1,==,socks->reply[3]);
+ tt_int_op(5,OP_EQ,socks->socks_version);
+ tt_int_op(10,OP_EQ,socks->replylen);
+ tt_int_op(5,OP_EQ,socks->reply[0]);
+ tt_int_op(SOCKS5_GENERAL_ERROR,OP_EQ,socks->reply[1]);
+ tt_int_op(1,OP_EQ,socks->reply[3]);
buf_clear(buf);
socks_request_clear(socks);
@@ -480,13 +480,13 @@ test_socks_5_malformed_commands(void *ptr)
ADD_DATA(buf, "\x05\x01\x00");
ADD_DATA(buf, "\x05\x01\x00\x23\x02\x02\x02\x02\x11\x11");
tt_int_op(fetch_from_buf_socks(buf, socks, get_options()->TestSocks,
- get_options()->SafeSocks),==, -1);
+ get_options()->SafeSocks),OP_EQ, -1);
- tt_int_op(5,==,socks->socks_version);
- tt_int_op(10,==,socks->replylen);
- tt_int_op(5,==,socks->reply[0]);
- tt_int_op(SOCKS5_ADDRESS_TYPE_NOT_SUPPORTED,==,socks->reply[1]);
- tt_int_op(1,==,socks->reply[3]);
+ tt_int_op(5,OP_EQ,socks->socks_version);
+ tt_int_op(10,OP_EQ,socks->replylen);
+ tt_int_op(5,OP_EQ,socks->reply[0]);
+ tt_int_op(SOCKS5_ADDRESS_TYPE_NOT_SUPPORTED,OP_EQ,socks->reply[1]);
+ tt_int_op(1,OP_EQ,socks->reply[3]);
done:
;