Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPP-956 Fix gcc compiler warnings for integration tests #527

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/src/integration/integration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Contributor

@mpenick mpenick Apr 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the code just be fixed to resolve the warning? I think CCM::BridgeException be --> CCM::BridgeException& be will fix.

#endif
try {
// Create and start the CCM cluster (if not already created)
ccm_ = new CCM::Bridge(
Expand Down Expand Up @@ -190,6 +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
}
}

Expand Down
27 changes: 17 additions & 10 deletions tests/src/integration/objects/cluster.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,21 +206,28 @@ class Cluster : public Object<CassCluster, cass_cluster_free> {
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
*/
/**
* 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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to have deprecation warnings.

#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
Expand Down
7 changes: 7 additions & 0 deletions tests/src/integration/objects/retry_policy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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