summaryrefslogtreecommitdiff
path: root/cpp/test
diff options
context:
space:
mode:
authorJoe George <joe@zeroc.com>2016-09-16 11:15:03 -0400
committerJoe George <joe@zeroc.com>2016-09-16 11:17:07 -0400
commitf4c6a36ff0478567a474f92408ba9a5b8c903832 (patch)
tree25c10e3518a0bd1006bd25c6a84f99d36e478b9b /cpp/test
parentFix for ICE-7357 - catch exceptions raised by connection getInfo (diff)
downloadice-f4c6a36ff0478567a474f92408ba9a5b8c903832.tar.bz2
ice-f4c6a36ff0478567a474f92408ba9a5b8c903832.tar.xz
ice-f4c6a36ff0478567a474f92408ba9a5b8c903832.zip
Fix ICE-7338
C++ IceSSL/configuration failures on macOS Sierra.
Diffstat (limited to 'cpp/test')
-rw-r--r--cpp/test/IceSSL/configuration/AllTests.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/cpp/test/IceSSL/configuration/AllTests.cpp b/cpp/test/IceSSL/configuration/AllTests.cpp
index cfa6506493e..10629281968 100644
--- a/cpp/test/IceSSL/configuration/AllTests.cpp
+++ b/cpp/test/IceSSL/configuration/AllTests.cpp
@@ -432,13 +432,20 @@ void
allTests(const CommunicatorPtr& communicator, const string& testDir, bool p12, bool shutdown)
{
#ifdef __APPLE__
- bool isElCapitan = false;
+ bool isElCapitanOrGreater = false;
vector<char> s(256);
size_t size = s.size();
int ret = sysctlbyname("kern.osrelease", &s[0], &size, NULL, 0);
if(ret == 0)
{
- isElCapitan = string(&s[0]).find("15.") == 0;
+ // version format is x.y.z
+ size_t first = string(&s[0]).find_first_of(".");
+ size_t last = string(&s[0]).find_last_of(".");
+
+ int majorVersion = atoi(string(&s[0]).substr(0, first - 1).c_str());
+ int minorVersion = atoi(string(&s[0]).substr(first + 1, last - first - 1).c_str());
+
+ isElCapitanOrGreater = majorVersion >= 15;
}
#endif
@@ -1940,7 +1947,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir, bool p12, b
}
catch(const LocalException& ex)
{
- if(!isElCapitan) // DH params too weak for El Capitan
+ if(!isElCapitanOrGreater) // DH params too weak for El Capitan
{
cerr << ex << endl;
test(false);