3636#include " ../src/Client/Connector.hpp"
3737
3838const char *localhost = " 127.0.0.1" ;
39- unsigned port = 3301 ;
39+ unsigned tarantool_port = 3301 ;
4040unsigned dummy_server_port = 3302 ;
4141const char *unixsocket = " ./tnt.sock" ;
4242int WAIT_TIMEOUT = 1000 ; // milliseconds
@@ -154,16 +154,16 @@ trivial(Connector<BUFFER, NetProvider> &client)
154154 fail_unless (rc != 0 );
155155 /* Connect to the wrong address. */
156156 TEST_CASE (" Bad address" );
157- rc = test_connect (client, conn, " asdasd" , port );
157+ rc = test_connect (client, conn, " asdasd" , tarantool_port );
158158 fail_unless (rc != 0 );
159159 TEST_CASE (" Unreachable address" );
160- rc = test_connect (client, conn, " 101.101.101" , port );
160+ rc = test_connect (client, conn, " 101.101.101" , tarantool_port );
161161 fail_unless (rc != 0 );
162162 TEST_CASE (" Wrong port" );
163163 rc = test_connect (client, conn, localhost, static_cast <uint>(-666 ));
164164 fail_unless (rc != 0 );
165165 TEST_CASE (" Connect timeout" );
166- rc = test_connect (client, conn, " 8.8.8.8" , port );
166+ rc = test_connect (client, conn, " 8.8.8.8" , tarantool_port );
167167 fail_unless (rc != 0 );
168168}
169169
@@ -174,7 +174,7 @@ single_conn_ping(Connector<BUFFER, NetProvider> &client)
174174{
175175 TEST_INIT (0 );
176176 Connection<Buf_t, NetProvider> conn (client);
177- int rc = test_connect (client, conn, localhost, port );
177+ int rc = test_connect (client, conn, localhost, tarantool_port );
178178 fail_unless (rc == 0 );
179179 rid_t f = conn.ping ();
180180 fail_unless (!conn.futureIsReady (f));
@@ -228,13 +228,13 @@ auto_close(Connector<BUFFER, NetProvider> &client)
228228 {
229229 TEST_CASE (" Without requests" );
230230 Connection<Buf_t, NetProvider> conn (client);
231- int rc = test_connect (client, conn, localhost, port );
231+ int rc = test_connect (client, conn, localhost, tarantool_port );
232232 fail_unless (rc == 0 );
233233 }
234234 {
235235 TEST_CASE (" With requests" );
236236 Connection<Buf_t, NetProvider> conn (client);
237- int rc = test_connect (client, conn, localhost, port );
237+ int rc = test_connect (client, conn, localhost, tarantool_port );
238238 fail_unless (rc == 0 );
239239
240240 rid_t f = conn.ping ();
@@ -255,18 +255,18 @@ many_conn_ping(Connector<BUFFER, NetProvider> &client)
255255 Connection<Buf_t, NetProvider> conn1 (client);
256256 Connection<Buf_t, NetProvider> conn2 (client);
257257 Connection<Buf_t, NetProvider> conn3 (client);
258- int rc = test_connect (client, conn1, localhost, port );
258+ int rc = test_connect (client, conn1, localhost, tarantool_port );
259259 fail_unless (rc == 0 );
260260 /* Try to connect to the same port */
261- rc = test_connect (client, conn2, localhost, port );
261+ rc = test_connect (client, conn2, localhost, tarantool_port );
262262 fail_unless (rc == 0 );
263263 /*
264264 * Try to re-connect to another address whithout closing
265265 * current connection.
266266 */
267- // rc = test_connect(client, conn2, localhost, port + 2);
267+ // rc = test_connect(client, conn2, localhost, tarantool_port + 2);
268268 // fail_unless(rc != 0);
269- rc = test_connect (client, conn3, localhost, port );
269+ rc = test_connect (client, conn3, localhost, tarantool_port );
270270 fail_unless (rc == 0 );
271271 rid_t f1 = conn1.ping ();
272272 rid_t f2 = conn2.ping ();
@@ -287,7 +287,7 @@ single_conn_error(Connector<BUFFER, NetProvider> &client)
287287{
288288 TEST_INIT (0 );
289289 Connection<Buf_t, NetProvider> conn (client);
290- int rc = test_connect (client, conn, localhost, port );
290+ int rc = test_connect (client, conn, localhost, tarantool_port );
291291 fail_unless (rc == 0 );
292292 /* Fake space id. */
293293 uint32_t space_id = static_cast <uint32_t >(-111 );
@@ -324,7 +324,7 @@ single_conn_replace(Connector<BUFFER, NetProvider> &client)
324324{
325325 TEST_INIT (0 );
326326 Connection<Buf_t, NetProvider> conn (client);
327- int rc = test_connect (client, conn, localhost, port );
327+ int rc = test_connect (client, conn, localhost, tarantool_port );
328328 fail_unless (rc == 0 );
329329 uint32_t space_id = 512 ;
330330 std::tuple data = std::make_tuple (666 , " 111" , 1.01 );
@@ -358,7 +358,7 @@ single_conn_insert(Connector<BUFFER, NetProvider> &client)
358358{
359359 TEST_INIT (0 );
360360 Connection<Buf_t, NetProvider> conn (client);
361- int rc = test_connect (client, conn, localhost, port );
361+ int rc = test_connect (client, conn, localhost, tarantool_port );
362362 fail_unless (rc == 0 );
363363 TEST_CASE (" Successful inserts" );
364364 uint32_t space_id = 512 ;
@@ -402,7 +402,7 @@ single_conn_update(Connector<BUFFER, NetProvider> &client)
402402{
403403 TEST_INIT (0 );
404404 Connection<Buf_t, NetProvider> conn (client);
405- int rc = test_connect (client, conn, localhost, port );
405+ int rc = test_connect (client, conn, localhost, tarantool_port );
406406 fail_unless (rc == 0 );
407407 TEST_CASE (" Successful update" );
408408 uint32_t space_id = 512 ;
@@ -437,7 +437,7 @@ single_conn_delete(Connector<BUFFER, NetProvider> &client)
437437{
438438 TEST_INIT (0 );
439439 Connection<Buf_t, NetProvider> conn (client);
440- int rc = test_connect (client, conn, localhost, port );
440+ int rc = test_connect (client, conn, localhost, tarantool_port );
441441 fail_unless (rc == 0 );
442442 TEST_CASE (" Successful deletes" );
443443 uint32_t space_id = 512 ;
@@ -481,7 +481,7 @@ single_conn_upsert(Connector<BUFFER, NetProvider> &client)
481481{
482482 TEST_INIT (0 );
483483 Connection<Buf_t, NetProvider> conn (client);
484- int rc = test_connect (client, conn, localhost, port );
484+ int rc = test_connect (client, conn, localhost, tarantool_port );
485485 fail_unless (rc == 0 );
486486 TEST_CASE (" upsert-insert" );
487487 uint32_t space_id = 512 ;
@@ -512,7 +512,7 @@ single_conn_select(Connector<BUFFER, NetProvider> &client)
512512{
513513 TEST_INIT (0 );
514514 Connection<Buf_t, NetProvider> conn (client);
515- int rc = test_connect (client, conn, localhost, port );
515+ int rc = test_connect (client, conn, localhost, tarantool_port );
516516 fail_unless (rc == 0 );
517517 uint32_t space_id = 512 ;
518518 uint32_t index_id = 0 ;
@@ -575,7 +575,7 @@ single_conn_call(Connector<BUFFER, NetProvider> &client)
575575 const static char *return_map = " remote_map" ;
576576
577577 Connection<Buf_t, NetProvider> conn (client);
578- int rc = test_connect (client, conn, localhost, port );
578+ int rc = test_connect (client, conn, localhost, tarantool_port );
579579 fail_unless (rc == 0 );
580580
581581 TEST_CASE (" call remote_replace" );
@@ -746,7 +746,7 @@ single_conn_sql(Connector<BUFFER, NetProvider> &client)
746746 using Body_t = Body<BUFFER>;
747747
748748 Connection<Buf_t, NetProvider> conn (client);
749- int rc = test_connect (client, conn, localhost, port );
749+ int rc = test_connect (client, conn, localhost, tarantool_port );
750750 fail_unless (rc == 0 );
751751
752752 TEST_CASE (" CREATE TABLE" );
@@ -990,7 +990,7 @@ test_auth(Connector<BUFFER, NetProvider> &client)
990990 const char *passwd = " megapassword" ;
991991
992992 Connection<Buf_t, NetProvider> conn (client);
993- int rc = test_connect (client, conn, localhost, port , user, passwd);
993+ int rc = test_connect (client, conn, localhost, tarantool_port , user, passwd);
994994 fail_unless (rc == 0 );
995995
996996 uint32_t space_id = 513 ;
0 commit comments