Skip to content

Commit 96a6731

Browse files
committed
tests: Fix Session.failover test.
The test was expecting that there is no server on host "localhost6" but actually on some platforms this name refers to IPv6 address of the local host and a server can be running there (in PB)!
1 parent ab6d6bb commit 96a6731

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

devapi/tests/session-t.cc

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,17 +1455,21 @@ TEST_F(Sess, failover)
14551455
uri << ":" << get_password();
14561456

14571457
uri << "@["
1458-
"localhost6,"
1459-
"wont_work:65535,"
1458+
"localhost6:65535,"
1459+
"wont_work,"
14601460
"[::1]:65535,";
14611461
uri << get_host();
14621462
if (get_port() != 0)
14631463
uri << ":" <<get_port();
14641464

14651465
uri << "]/test";
14661466

1467+
cout << "Connecting using URI: " << uri.str() << endl;
1468+
14671469
mysqlx::Session s(uri.str());
14681470

1471+
cout << "Connected." << endl;
1472+
14691473
EXPECT_EQ(string("test"),s.getDefaultSchema().getName());
14701474
}
14711475

@@ -3042,7 +3046,12 @@ TEST_F(Sess, compression_algorithms)
30423046
{
30433047
SKIP_IF_NO_XPLUGIN;
30443048

3045-
auto check_compress_alg = [](mysqlx::Session s,string expected, int line)
3049+
/*
3050+
Note: this captured to use Sess::get_var(). Even though it is static
3051+
member, compiler (msvc) generated warning without the capture.
3052+
*/
3053+
3054+
auto check_compress_alg = [this](mysqlx::Session s,string expected, int line)
30463055
{
30473056
std::string result = Sess::get_var(s, "Mysqlx_compression_algorithm");
30483057
if (expected != result)

0 commit comments

Comments
 (0)