Order member variable initialization in TestConnections

The variables are now initialized in order and always in the constructor.
This commit is contained in:
Markus Mäkelä
2017-10-05 08:06:10 +03:00
parent a3ba81ddbe
commit a4271cb94e
2 changed files with 17 additions and 23 deletions

View File

@ -63,22 +63,28 @@ void TestConnections::require_galera_version(const char *version)
} }
TestConnections::TestConnections(int argc, char *argv[]): TestConnections::TestConnections(int argc, char *argv[]):
no_backend_log_copy(false), enable_timeouts(true),
use_snapshots(false), global_result(0),
verbose(false),
smoke(true),
rwsplit_port(4006), rwsplit_port(4006),
readconn_master_port(4008), readconn_master_port(4008),
readconn_slave_port(4009), readconn_slave_port(4009),
binlog_port(5306), binlog_port(5306),
global_result(0), conn_rwsplit(NULL),
binlog_cmd_option(0), conn_master(NULL),
enable_timeouts(true), conn_slave(NULL),
use_ipv6(false), use_ipv6(false),
no_galera(false), use_snapshots(false),
no_backend_log_copy(false),
verbose(false),
smoke(true),
binlog_cmd_option(0),
ssl(false),
backend_ssl(false),
binlog_master_gtid(false), binlog_master_gtid(false),
binlog_slave_gtid(false), binlog_slave_gtid(false),
no_vm_revert(true) no_galera(false),
no_vm_revert(true),
threads(4)
{ {
signal_set(SIGSEGV, sigfatal_handler); signal_set(SIGSEGV, sigfatal_handler);
signal_set(SIGABRT, sigfatal_handler); signal_set(SIGABRT, sigfatal_handler);
@ -484,7 +490,7 @@ int TestConnections::read_env()
{ {
sprintf(maxscale_access_sudo, "%s", env); sprintf(maxscale_access_sudo, "%s", env);
} }
ssl = false;
env = getenv("ssl"); env = getenv("ssl");
if ((env != NULL) && ((strcasecmp(env, "yes") == 0) || (strcasecmp(env, "true") == 0) )) if ((env != NULL) && ((strcasecmp(env, "yes") == 0) || (strcasecmp(env, "true") == 0) ))
{ {
@ -527,10 +533,6 @@ int TestConnections::read_env()
{ {
backend_ssl = true; backend_ssl = true;
} }
else
{
backend_ssl = false;
}
if (strcmp(maxscale_access_user, "root") == 0) if (strcmp(maxscale_access_user, "root") == 0)
{ {
@ -553,20 +555,12 @@ int TestConnections::read_env()
{ {
sscanf(env, "%d", &threads); sscanf(env, "%d", &threads);
} }
else
{
threads = 4;
}
env = getenv("use_snapshots"); env = getenv("use_snapshots");
if (env != NULL && ((strcasecmp(env, "yes") == 0) || (strcasecmp(env, "true") == 0) )) if (env != NULL && ((strcasecmp(env, "yes") == 0) || (strcasecmp(env, "true") == 0) ))
{ {
use_snapshots = true; use_snapshots = true;
} }
else
{
use_snapshots = false;
}
env = getenv("take_snapshot_command"); env = getenv("take_snapshot_command");
if (env != NULL) if (env != NULL)
{ {

View File

@ -257,7 +257,7 @@ public:
/** /**
* @brief ssl if true ssl will be used * @brief ssl if true ssl will be used
*/ */
int ssl; bool ssl;
/** /**
* @brief backend_ssl if true ssl configuratio for all servers will be added * @brief backend_ssl if true ssl configuratio for all servers will be added