From 7319176df2371922e244aee564b3228ff04ddf2b Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Mon, 28 Mar 2022 17:04:12 -0500 Subject: [PATCH 1/5] Initial fix for deprecated warnings --- tests/src/integration/objects/cluster.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/src/integration/objects/cluster.hpp b/tests/src/integration/objects/cluster.hpp index a03f1af93..52aba5f03 100644 --- a/tests/src/integration/objects/cluster.hpp +++ b/tests/src/integration/objects/cluster.hpp @@ -216,11 +216,18 @@ class Cluster : public Object { * otherwise (default: true) * @return Cluster object */ + #if defined(__GNUC__) || defined(__INTEL_COMPILER) + # pragma GCC diagnostic push + # pragma GCC diagnostic ignored "-Wdeprecated-declarations" + #endif Cluster& with_hostname_resolution(bool enable = true) { EXPECT_EQ(CASS_OK, cass_cluster_set_use_hostname_resolution( get(), (enable == true ? cass_true : cass_false))); return *this; } + #if defined(__GNUC__) || defined(__INTEL_COMPILER) + # pragma GCC diagnostic pop + #endif /** * Sets the number of I/O threads. This is the number of threads that will From 16f1bdb87058a1c0235192446b9af49353d47224 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Mon, 28 Mar 2022 17:16:16 -0500 Subject: [PATCH 2/5] Fix another deprecated warning around retry policy tests --- tests/src/integration/objects/retry_policy.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/src/integration/objects/retry_policy.cpp b/tests/src/integration/objects/retry_policy.cpp index cde330172..8d5afd3cb 100644 --- a/tests/src/integration/objects/retry_policy.cpp +++ b/tests/src/integration/objects/retry_policy.cpp @@ -18,5 +18,12 @@ using namespace test::driver; +#if defined(__GNUC__) || defined(__INTEL_COMPILER) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif DowngradingConsistencyRetryPolicy::DowngradingConsistencyRetryPolicy() : RetryPolicy(cass_retry_policy_downgrading_consistency_new()) {} +#if defined(__GNUC__) || defined(__INTEL_COMPILER) +# pragma GCC diagnostic pop +#endif From c6eea8691a3113bb241f896a7a330c25c3be0f3f Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Mon, 28 Mar 2022 17:31:21 -0500 Subject: [PATCH 3/5] One last ignore, this time in ccm code --- tests/src/integration/integration.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/src/integration/integration.cpp b/tests/src/integration/integration.cpp index 157be38ac..628d806fa 100644 --- a/tests/src/integration/integration.cpp +++ b/tests/src/integration/integration.cpp @@ -148,6 +148,10 @@ void Integration::SetUp() { data_center_nodes.push_back(number_dc2_nodes_); if (is_ccm_requested_) { + #if defined(__GNUC__) || defined(__INTEL_COMPILER) + # pragma GCC diagnostic push + # pragma GCC diagnostic ignored "-Wcatch-value" + #endif try { // Create and start the CCM cluster (if not already created) ccm_ = new CCM::Bridge( @@ -186,10 +190,14 @@ void Integration::SetUp() { if (is_session_requested_ && is_ccm_start_requested_) { connect(); } - } catch (CCM::BridgeException be) { + } + catch (CCM::BridgeException be) { // Issue creating the CCM bridge instance (force failure) FAIL() << be.what(); } + #if defined(__GNUC__) || defined(__INTEL_COMPILER) + # pragma GCC diagnostic pop + #endif } } From d32ca0fbe480726e96898af6a63bbaf4d8baf236 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Mon, 28 Mar 2022 17:32:37 -0500 Subject: [PATCH 4/5] Changed code format slightly in an earlier attempt to mitigate the problem. Now it's time to change it back. --- tests/src/integration/integration.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/src/integration/integration.cpp b/tests/src/integration/integration.cpp index 628d806fa..0d78cd0b6 100644 --- a/tests/src/integration/integration.cpp +++ b/tests/src/integration/integration.cpp @@ -190,8 +190,7 @@ void Integration::SetUp() { if (is_session_requested_ && is_ccm_start_requested_) { connect(); } - } - catch (CCM::BridgeException be) { + } catch (CCM::BridgeException be) { // Issue creating the CCM bridge instance (force failure) FAIL() << be.what(); } From 1b4ca7053242bf708e4de92c8f6d0e801b7f8c7a Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Tue, 29 Mar 2022 13:08:08 -0500 Subject: [PATCH 5/5] Format changes to address formatting failures on Ubuntu Bionic --- tests/src/integration/integration.cpp | 14 ++++---- tests/src/integration/objects/cluster.hpp | 34 +++++++++---------- .../src/integration/objects/retry_policy.cpp | 6 ++-- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/tests/src/integration/integration.cpp b/tests/src/integration/integration.cpp index 0d78cd0b6..120637e79 100644 --- a/tests/src/integration/integration.cpp +++ b/tests/src/integration/integration.cpp @@ -148,10 +148,10 @@ void Integration::SetUp() { data_center_nodes.push_back(number_dc2_nodes_); if (is_ccm_requested_) { - #if defined(__GNUC__) || defined(__INTEL_COMPILER) - # pragma GCC diagnostic push - # pragma GCC diagnostic ignored "-Wcatch-value" - #endif +#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcatch-value" +#endif try { // Create and start the CCM cluster (if not already created) ccm_ = new CCM::Bridge( @@ -194,9 +194,9 @@ void Integration::SetUp() { // Issue creating the CCM bridge instance (force failure) FAIL() << be.what(); } - #if defined(__GNUC__) || defined(__INTEL_COMPILER) - # pragma GCC diagnostic pop - #endif +#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#pragma GCC diagnostic pop +#endif } } diff --git a/tests/src/integration/objects/cluster.hpp b/tests/src/integration/objects/cluster.hpp index 52aba5f03..468b3a628 100644 --- a/tests/src/integration/objects/cluster.hpp +++ b/tests/src/integration/objects/cluster.hpp @@ -206,28 +206,28 @@ class Cluster : public Object { return *this; } - /** - * Enable/Disable the use of hostname resolution - * - * This is useful for authentication (Kerberos) or encryption (SSL) - * services that require a valid hostname for verification. - * - * @param enable True if hostname resolution should be enabled; false - * otherwise (default: true) - * @return Cluster object - */ - #if defined(__GNUC__) || defined(__INTEL_COMPILER) - # pragma GCC diagnostic push - # pragma GCC diagnostic ignored "-Wdeprecated-declarations" - #endif +/** + * Enable/Disable the use of hostname resolution + * + * This is useful for authentication (Kerberos) or encryption (SSL) + * services that require a valid hostname for verification. + * + * @param enable True if hostname resolution should be enabled; false + * otherwise (default: true) + * @return Cluster object + */ +#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif Cluster& with_hostname_resolution(bool enable = true) { EXPECT_EQ(CASS_OK, cass_cluster_set_use_hostname_resolution( get(), (enable == true ? cass_true : cass_false))); return *this; } - #if defined(__GNUC__) || defined(__INTEL_COMPILER) - # pragma GCC diagnostic pop - #endif +#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#pragma GCC diagnostic pop +#endif /** * Sets the number of I/O threads. This is the number of threads that will diff --git a/tests/src/integration/objects/retry_policy.cpp b/tests/src/integration/objects/retry_policy.cpp index 8d5afd3cb..f47a7dcf9 100644 --- a/tests/src/integration/objects/retry_policy.cpp +++ b/tests/src/integration/objects/retry_policy.cpp @@ -19,11 +19,11 @@ using namespace test::driver; #if defined(__GNUC__) || defined(__INTEL_COMPILER) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif DowngradingConsistencyRetryPolicy::DowngradingConsistencyRetryPolicy() : RetryPolicy(cass_retry_policy_downgrading_consistency_new()) {} #if defined(__GNUC__) || defined(__INTEL_COMPILER) -# pragma GCC diagnostic pop +#pragma GCC diagnostic pop #endif