Fix gtest and related warnings (#1224)
This commit is contained in:
parent
1502468dba
commit
e3d8719281
@ -38,11 +38,19 @@ inline void LogThis(std::string const& msg)
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(push)
|
||||
// C26812: The enum type 'CURLoption' is unscoped. Prefer 'enum class' over 'enum' (Enum.3)
|
||||
#pragma warning(disable : 26812)
|
||||
#endif
|
||||
inline bool SetLibcurlOption(CURL* handle, CURLoption option, T value, CURLcode* outError)
|
||||
{
|
||||
*outError = curl_easy_setopt(handle, option, value);
|
||||
return *outError == CURLE_OK;
|
||||
}
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
enum class PollSocketDirection
|
||||
{
|
||||
|
||||
@ -101,7 +101,15 @@ namespace Azure { namespace Core { namespace Http {
|
||||
// Get the socket that libcurl is using from handle. Will use this to wait while
|
||||
// reading/writing
|
||||
// into wire
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(push)
|
||||
// C26812: The enum type 'CURLcode' is unscoped. Prefer 'enum class' over 'enum' (Enum.3)
|
||||
#pragma warning(disable : 26812)
|
||||
#endif
|
||||
auto result = curl_easy_getinfo(m_handle, CURLINFO_ACTIVESOCKET, &m_curlSocket);
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
if (result != CURLE_OK)
|
||||
{
|
||||
throw Http::TransportException(
|
||||
|
||||
@ -52,6 +52,21 @@ add_executable (
|
||||
uuid.cpp
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
# Disable warnings:
|
||||
# - C26495: Variable
|
||||
# - 'testing::internal::Mutex::critical_section_'
|
||||
# - 'testing::internal::Mutex::critical_section_init_phase_'
|
||||
# - 'testing::internal::Mutex::owner_thread_id_'
|
||||
# - 'testing::internal::Mutex::type_'
|
||||
# is uninitialized. Always initialize member variables (type.6).
|
||||
# - C26812: The enum type
|
||||
# - 'testing::internal::Mutex::StaticConstructorSelector'
|
||||
# - 'testing::TestPartResult::Type'
|
||||
# is unscoped. Prefer 'enum class' over 'enum' (Enum.3)
|
||||
target_compile_options(azure-core-test PUBLIC /wd26495 /wd26812)
|
||||
endif()
|
||||
|
||||
# Adding private headers from CORE to the tests so we can test the private APIs with no relative paths include.
|
||||
target_include_directories (azure-core-test PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../src>)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user