36
36
#include " ../src/Client/Connector.hpp"
37
37
38
38
const char *localhost = " 127.0.0.1" ;
39
- unsigned port = 3301 ;
39
+ unsigned tarantool_port = 3301 ;
40
40
unsigned dummy_server_port = 3302 ;
41
41
const char *unixsocket = " ./tnt.sock" ;
42
42
int WAIT_TIMEOUT = 1000 ; // milliseconds
@@ -154,16 +154,16 @@ trivial(Connector<BUFFER, NetProvider> &client)
154
154
fail_unless (rc != 0 );
155
155
/* Connect to the wrong address. */
156
156
TEST_CASE (" Bad address" );
157
- rc = test_connect (client, conn, " asdasd" , port );
157
+ rc = test_connect (client, conn, " asdasd" , tarantool_port );
158
158
fail_unless (rc != 0 );
159
159
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 );
161
161
fail_unless (rc != 0 );
162
162
TEST_CASE (" Wrong port" );
163
163
rc = test_connect (client, conn, localhost, static_cast <uint >(-666 ));
164
164
fail_unless (rc != 0 );
165
165
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 );
167
167
fail_unless (rc != 0 );
168
168
}
169
169
@@ -174,7 +174,7 @@ single_conn_ping(Connector<BUFFER, NetProvider> &client)
174
174
{
175
175
TEST_INIT (0 );
176
176
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 );
178
178
fail_unless (rc == 0 );
179
179
rid_t f = conn.ping ();
180
180
fail_unless (!conn.futureIsReady (f));
@@ -228,13 +228,13 @@ auto_close(Connector<BUFFER, NetProvider> &client)
228
228
{
229
229
TEST_CASE (" Without requests" );
230
230
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 );
232
232
fail_unless (rc == 0 );
233
233
}
234
234
{
235
235
TEST_CASE (" With requests" );
236
236
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 );
238
238
fail_unless (rc == 0 );
239
239
240
240
rid_t f = conn.ping ();
@@ -255,18 +255,18 @@ many_conn_ping(Connector<BUFFER, NetProvider> &client)
255
255
Connection<Buf_t, NetProvider> conn1 (client);
256
256
Connection<Buf_t, NetProvider> conn2 (client);
257
257
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 );
259
259
fail_unless (rc == 0 );
260
260
/* Try to connect to the same port */
261
- rc = test_connect (client, conn2, localhost, port );
261
+ rc = test_connect (client, conn2, localhost, tarantool_port );
262
262
fail_unless (rc == 0 );
263
263
/*
264
264
* Try to re-connect to another address whithout closing
265
265
* current connection.
266
266
*/
267
- // rc = test_connect(client, conn2, localhost, port + 2);
267
+ // rc = test_connect(client, conn2, localhost, tarantool_port + 2);
268
268
// fail_unless(rc != 0);
269
- rc = test_connect (client, conn3, localhost, port );
269
+ rc = test_connect (client, conn3, localhost, tarantool_port );
270
270
fail_unless (rc == 0 );
271
271
rid_t f1 = conn1.ping ();
272
272
rid_t f2 = conn2.ping ();
@@ -287,7 +287,7 @@ single_conn_error(Connector<BUFFER, NetProvider> &client)
287
287
{
288
288
TEST_INIT (0 );
289
289
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 );
291
291
fail_unless (rc == 0 );
292
292
/* Fake space id. */
293
293
uint32_t space_id = static_cast <uint32_t >(-111 );
@@ -324,7 +324,7 @@ single_conn_replace(Connector<BUFFER, NetProvider> &client)
324
324
{
325
325
TEST_INIT (0 );
326
326
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 );
328
328
fail_unless (rc == 0 );
329
329
uint32_t space_id = 512 ;
330
330
std::tuple data = std::make_tuple (666 , " 111" , 1.01 );
@@ -358,7 +358,7 @@ single_conn_insert(Connector<BUFFER, NetProvider> &client)
358
358
{
359
359
TEST_INIT (0 );
360
360
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 );
362
362
fail_unless (rc == 0 );
363
363
TEST_CASE (" Successful inserts" );
364
364
uint32_t space_id = 512 ;
@@ -402,7 +402,7 @@ single_conn_update(Connector<BUFFER, NetProvider> &client)
402
402
{
403
403
TEST_INIT (0 );
404
404
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 );
406
406
fail_unless (rc == 0 );
407
407
TEST_CASE (" Successful update" );
408
408
uint32_t space_id = 512 ;
@@ -437,7 +437,7 @@ single_conn_delete(Connector<BUFFER, NetProvider> &client)
437
437
{
438
438
TEST_INIT (0 );
439
439
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 );
441
441
fail_unless (rc == 0 );
442
442
TEST_CASE (" Successful deletes" );
443
443
uint32_t space_id = 512 ;
@@ -481,7 +481,7 @@ single_conn_upsert(Connector<BUFFER, NetProvider> &client)
481
481
{
482
482
TEST_INIT (0 );
483
483
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 );
485
485
fail_unless (rc == 0 );
486
486
TEST_CASE (" upsert-insert" );
487
487
uint32_t space_id = 512 ;
@@ -512,7 +512,7 @@ single_conn_select(Connector<BUFFER, NetProvider> &client)
512
512
{
513
513
TEST_INIT (0 );
514
514
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 );
516
516
fail_unless (rc == 0 );
517
517
uint32_t space_id = 512 ;
518
518
uint32_t index_id = 0 ;
@@ -575,7 +575,7 @@ single_conn_call(Connector<BUFFER, NetProvider> &client)
575
575
const static char *return_map = " remote_map" ;
576
576
577
577
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 );
579
579
fail_unless (rc == 0 );
580
580
581
581
TEST_CASE (" call remote_replace" );
@@ -746,7 +746,7 @@ single_conn_sql(Connector<BUFFER, NetProvider> &client)
746
746
using Body_t = Body<BUFFER>;
747
747
748
748
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 );
750
750
fail_unless (rc == 0 );
751
751
752
752
TEST_CASE (" CREATE TABLE" );
@@ -990,7 +990,7 @@ test_auth(Connector<BUFFER, NetProvider> &client)
990
990
const char *passwd = " megapassword" ;
991
991
992
992
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);
994
994
fail_unless (rc == 0 );
995
995
996
996
uint32_t space_id = 513 ;
0 commit comments