Skip to content

Commit 40ddfdf

Browse files
author
Andrzej Religa
committed
Bug#33986295 Fix the deprecation warnings on Windows for router
This patch replaces occurences of deprecated INSTANTIATE_TEST_CASE_P in the Router tests with INSTANTIATE_TEST_SUITE_P Change-Id: Iadbc98fec0c20414101576b362354e55970d087d
1 parent c62d4d4 commit 40ddfdf

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

router/tests/component/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ MYSQL_ADD_EXECUTABLE(master_key_test_writer
3030
SKIP_INSTALL
3131
)
3232

33-
#TODO(Bug#33986295): fix the deprecation for router tests
34-
IF(MSVC)
35-
STRING_APPEND(CMAKE_C_FLAGS " /wd4996")
36-
STRING_APPEND(CMAKE_CXX_FLAGS " /wd4996")
37-
ENDIF()
38-
3933
ADD_DEFINITIONS(-DSSL_TEST_DATA_DIR="${CMAKE_SOURCE_DIR}/mysql-test/std_data/")
4034
ADD_DEFINITIONS(-DCMAKE_SOURCE_DIR="${CMAKE_SOURCE_DIR}")
4135
FOREACH(test_file

router/tests/component/test_mock_server.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,9 @@ const MockServerCLITestParam mock_server_cli_test_param[] = {
230230
}},
231231
};
232232

233-
INSTANTIATE_TEST_CASE_P(Spec, MockServerCLITest,
234-
::testing::ValuesIn(mock_server_cli_test_param),
235-
[](const auto &info) { return info.param.test_name; });
233+
INSTANTIATE_TEST_SUITE_P(Spec, MockServerCLITest,
234+
::testing::ValuesIn(mock_server_cli_test_param),
235+
[](const auto &info) { return info.param.test_name; });
236236

237237
class MockServerCLITestBase : public RouterComponentTest {};
238238

@@ -563,9 +563,9 @@ const MockServerConnectOkTestParam mock_server_connect_ok_test_param[] = {
563563
}},
564564
};
565565

566-
INSTANTIATE_TEST_CASE_P(Spec, MockServerConnectOkTest,
567-
::testing::ValuesIn(mock_server_connect_ok_test_param),
568-
[](const auto &info) { return info.param.test_name; });
566+
INSTANTIATE_TEST_SUITE_P(Spec, MockServerConnectOkTest,
567+
::testing::ValuesIn(mock_server_connect_ok_test_param),
568+
[](const auto &info) { return info.param.test_name; });
569569

570570
// custom connect tests
571571

@@ -1058,9 +1058,9 @@ const MockServerConnectTestParam mock_server_connect_test_param[] = {
10581058
}},
10591059
};
10601060

1061-
INSTANTIATE_TEST_CASE_P(Spec, MockServerConnectTest,
1062-
::testing::ValuesIn(mock_server_connect_test_param),
1063-
[](const auto &info) { return info.param.test_name; });
1061+
INSTANTIATE_TEST_SUITE_P(Spec, MockServerConnectTest,
1062+
::testing::ValuesIn(mock_server_connect_test_param),
1063+
[](const auto &info) { return info.param.test_name; });
10641064

10651065
int main(int argc, char *argv[]) {
10661066
net::impl::socket::init();

router/tests/component/test_sd_notify.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ TEST_P(NotifyTestInvalidSocketNameTest, NotifyTestInvalidSocketName) {
570570
2s));
571571
}
572572

573-
INSTANTIATE_TEST_CASE_P(
573+
INSTANTIATE_TEST_SUITE_P(
574574
NotifyTestInvalidSocketName, NotifyTestInvalidSocketNameTest,
575575
::testing::Values(
576576
"CON", "PRN",
@@ -936,7 +936,7 @@ TEST_P(NotifyBootstrapNotAffectedTest, NotifyBootstrapNotAffected) {
936936
stdx::make_unexpected(make_error_code(std::errc::timed_out)));
937937
}
938938

939-
INSTANTIATE_TEST_CASE_P(
939+
INSTANTIATE_TEST_SUITE_P(
940940
NotifyBootstrapNotAffected, NotifyBootstrapNotAffectedTest,
941941
::testing::Values("READY=1",
942942
"STOPPING=1\nSTATUS=Router shutdown in progress\n"));

0 commit comments

Comments
 (0)