Skip to content

Commit

Permalink
make CommandLine cl; a global
Browse files Browse the repository at this point in the history
  • Loading branch information
mirostauder committed Mar 20, 2024
1 parent a5cf8f2 commit bbf9408
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions test/tap/tests/test_auth_methods-t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#include "command_line.h"
#include "utils.h"

CommandLine cl;

// Additional env variables
uint32_t TAP_MYSQL8_BACKEND_HG = 30;
uint32_t TAP_NUM_CLIENT_THREADS = 4;
Expand Down Expand Up @@ -1659,12 +1661,6 @@ int test_all_confs_creds(
}

int main(int argc, char** argv) {
CommandLine cl;

if (cl.getEnv()) {
diag("Failed to get the required environmental variables.");
return EXIT_FAILURE;
}

TAP_MYSQL8_BACKEND_HG = get_env_int("TAP_MYSQL8_BACKEND_HG", 30);
TAP_NUM_CLIENT_THREADS = get_env_int("TAP_NUM_CLIENT_THREADS", 4);
Expand Down
8 changes: 2 additions & 6 deletions test/tap/tests/test_change_user-t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ using nlohmann::json;

#define NCONNS 16

CommandLine cl;

int run_queries_sets(std::vector<std::string>& queries, MYSQL *my, const std::string& message_prefix) {
for (std::vector<std::string>::iterator it = queries.begin(); it != queries.end(); it++) {
std::string q = *it;
Expand Down Expand Up @@ -193,7 +195,6 @@ int TestSet1(const CommandLine& cl, const char *plugin, bool test_ssl , bool tes
}

int main(int argc, char** argv) {
CommandLine cl;

int p = 1; // admin connection
// with mysql-default_authentication_plugin = mysql_native_password
Expand Down Expand Up @@ -229,11 +230,6 @@ int main(int argc, char** argv) {

plan(p);

if (cl.getEnv()) {
diag("Failed to get the required environmental variables.");
return EXIT_FAILURE;
}

int rc = 0;
admin = mysql_init(NULL);
{
Expand Down

0 comments on commit bbf9408

Please sign in to comment.