1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-07 02:42:49 +03:00

Instead of mysql_real_connect in tests we call now my_test_connect to apply global options like tls usage

This commit is contained in:
Georg Richter
2016-09-08 07:59:34 +02:00
parent 9f88e25fd6
commit b0506f63e9
8 changed files with 79 additions and 41 deletions

View File

@@ -910,7 +910,7 @@ static int test_connect_attrs(MYSQL *my)
mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD, "foo1", "bar1");
mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD, "foo2", "bar2");
FAIL_IF(!mysql_real_connect(mysql, hostname, username, password, schema,
FAIL_IF(!my_test_connect(mysql, hostname, username, password, schema,
port, socketname, 0), mysql_error(my));
if (!(mysql->server_capabilities & CLIENT_CONNECT_ATTRS))
@@ -959,7 +959,7 @@ static int test_conc117(MYSQL *unused __attribute__((unused)))
{
my_bool reconnect= 1;
MYSQL *my= mysql_init(NULL);
FAIL_IF(!mysql_real_connect(my, hostname, username, password, schema,
FAIL_IF(!my_test_connect(my, hostname, username, password, schema,
port, socketname, 0), mysql_error(my));
mysql_kill(my, mysql_thread_id(my));
@@ -978,7 +978,7 @@ static int test_read_timeout(MYSQL *unused __attribute__((unused)))
int timeout= 5, rc;
MYSQL *my= mysql_init(NULL);
mysql_options(my, MYSQL_OPT_READ_TIMEOUT, &timeout);
FAIL_IF(!mysql_real_connect(my, hostname, username, password, schema,
FAIL_IF(!my_test_connect(my, hostname, username, password, schema,
port, socketname, 0), mysql_error(my));
rc= mysql_query(my, "SELECT SLEEP(50)");
@@ -1034,7 +1034,7 @@ static int test_remote2(MYSQL *my)
mysql_options(mysql, MYSQL_READ_DEFAULT_FILE, "http://localhost/test.cnf");
mysql_options(mysql, MYSQL_READ_DEFAULT_GROUP, "test");
mysql_real_connect(mysql, hostname, username, password, schema,
my_test_connect(mysql, hostname, username, password, schema,
0, socketname, 0), mysql_error(my);
diag("port: %d", mysql->port);
mysql_close(mysql);