summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Thomson <martin.thomson@gmail.com>2015-10-19 10:28:19 -0700
committerMartin Thomson <martin.thomson@gmail.com>2015-10-19 10:28:19 -0700
commitc4c057fbfe6d25d02448ea4619e56093e7ac0624 (patch)
tree03c66080c12b3e3ba951fad1ab1a008263b5b29a
parent1479a8c499b4f292b3e7c24cf146e29d4ac6a5be (diff)
downloadnss-hg-c4c057fbfe6d25d02448ea4619e56093e7ac0624.tar.gz
Bug 1214390 - Fixing compilation errors on Windows, r=ekr,wtc
-rw-r--r--Makefile4
-rw-r--r--coreconf/WIN32.mk3
-rw-r--r--external_tests/ssl_gtest/Makefile3
-rw-r--r--external_tests/ssl_gtest/ssl_gtest.cc3
-rw-r--r--external_tests/ssl_gtest/tls_agent.cc14
-rw-r--r--manifest.mn6
-rwxr-xr-xtests/ssl_gtests/ssl_gtests.sh10
7 files changed, 25 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index bfedabe8f..41f864d6f 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,9 @@ include $(CORE_DEPTH)/coreconf/config.mk
# (4) Include "local" platform-dependent assignments (OPTIONAL). #
#######################################################################
-
+ifdef NSS_DISABLE_GTESTS
+DIRS := $(filter-out external_tests,$(DIRS))
+endif
#######################################################################
# (5) Execute "global" rules. (OPTIONAL) #
diff --git a/coreconf/WIN32.mk b/coreconf/WIN32.mk
index b8f8f48c4..ad5858ff6 100644
--- a/coreconf/WIN32.mk
+++ b/coreconf/WIN32.mk
@@ -192,7 +192,8 @@ ifneq ($(_MSC_VER),$(_MSC_VER_6))
# Disable C4267: conversion from 'size_t' to 'type', possible loss of data
# Disable C4244: conversion from 'type1' to 'type2', possible loss of data
# Disable C4018: 'expression' : signed/unsigned mismatch
- OS_CFLAGS += -w44267 -w44244 -w44018
+ # Disable C4312: 'type cast': conversion from 'type1' to 'type2' of greater size
+ OS_CFLAGS += -w44267 -w44244 -w44018 -w44312
ifeq ($(_MSC_VER_GE_12),1)
OS_CFLAGS += -FS
endif
diff --git a/external_tests/ssl_gtest/Makefile b/external_tests/ssl_gtest/Makefile
index 7f36bffe4..7a2f354f0 100644
--- a/external_tests/ssl_gtest/Makefile
+++ b/external_tests/ssl_gtest/Makefile
@@ -43,7 +43,6 @@ include $(CORE_DEPTH)/coreconf/rules.mk
#######################################################################
MKPROG = $(CCC)
-CXXFLAGS += -std=c++0x
CFLAGS += -I$(CORE_DEPTH)/lib/ssl
include ../../cmd/platrules.mk
@@ -58,4 +57,6 @@ ifeq (WINNT,$(OS_ARCH))
# Linking to winsock to get htonl
OS_LIBS += Ws2_32.lib
+else
+ CXXFLAGS += -std=c++0x
endif
diff --git a/external_tests/ssl_gtest/ssl_gtest.cc b/external_tests/ssl_gtest/ssl_gtest.cc
index 938b013af..ee1c40cfd 100644
--- a/external_tests/ssl_gtest/ssl_gtest.cc
+++ b/external_tests/ssl_gtest/ssl_gtest.cc
@@ -16,9 +16,6 @@ int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
g_working_dir_path = ".";
- // Temporarily disable asserts for PKCS#11 slot leakage until
- // Bug 1168425 is fixed.
- unsetenv("NSS_STRICT_SHUTDOWN");
char* workdir = getenv("NSS_GTEST_WORKDIR");
if (workdir)
g_working_dir_path = workdir;
diff --git a/external_tests/ssl_gtest/tls_agent.cc b/external_tests/ssl_gtest/tls_agent.cc
index 16a39329d..bb82a8daa 100644
--- a/external_tests/ssl_gtest/tls_agent.cc
+++ b/external_tests/ssl_gtest/tls_agent.cc
@@ -236,24 +236,24 @@ void TlsAgent::SetSignatureAlgorithms(const SSLSignatureAndHashAlg* algorithms,
EXPECT_EQ(SECFailure, SSL_SignaturePrefSet(ssl_fd_, algorithms, 0))
<< "setting no algorithms should fail and do nothing";
+ std::vector<SSLSignatureAndHashAlg> configuredAlgorithms(count);
unsigned int configuredCount;
- SSLSignatureAndHashAlg configuredAlgorithms[count];
EXPECT_EQ(SECFailure,
SSL_SignaturePrefGet(ssl_fd_, nullptr, &configuredCount, 1))
<< "get algorithms, algorithms is nullptr";
EXPECT_EQ(SECFailure,
- SSL_SignaturePrefGet(ssl_fd_, configuredAlgorithms,
+ SSL_SignaturePrefGet(ssl_fd_, &configuredAlgorithms[0],
&configuredCount, 0))
<< "get algorithms, too little space";
EXPECT_EQ(SECFailure,
- SSL_SignaturePrefGet(ssl_fd_, configuredAlgorithms, nullptr,
- PR_ARRAY_SIZE(configuredAlgorithms)))
+ SSL_SignaturePrefGet(ssl_fd_, &configuredAlgorithms[0],
+ nullptr, configuredAlgorithms.size()))
<< "get algorithms, algCountOut is nullptr";
EXPECT_EQ(SECSuccess,
- SSL_SignaturePrefGet(ssl_fd_, configuredAlgorithms,
+ SSL_SignaturePrefGet(ssl_fd_, &configuredAlgorithms[0],
&configuredCount,
- PR_ARRAY_SIZE(configuredAlgorithms)));
+ configuredAlgorithms.size()));
// SignaturePrefSet drops unsupported algorithms silently, so the number that
// are configured might be fewer.
EXPECT_LE(configuredCount, count);
@@ -405,7 +405,7 @@ void TlsAgent::EnableExtendedMasterSecret() {
}
void TlsAgent::CheckExtendedMasterSecret(bool expected) {
- ASSERT_EQ(expected, info_.extendedMasterSecretUsed)
+ ASSERT_EQ(expected, static_cast<bool>(info_.extendedMasterSecretUsed))
<< "unexpected extended master secret state for " << name_;
}
diff --git a/manifest.mn b/manifest.mn
index 8a25f8277..cb2470bf4 100644
--- a/manifest.mn
+++ b/manifest.mn
@@ -10,8 +10,4 @@ IMPORTS = nspr20/v4.8 \
RELEASE = nss
-DIRS = coreconf lib cmd
-
-ifndef NSS_DISABLE_GTESTS
-DIRS += external_tests
-endif
+DIRS = coreconf lib cmd external_tests
diff --git a/tests/ssl_gtests/ssl_gtests.sh b/tests/ssl_gtests/ssl_gtests.sh
index ad3d4448d..f57ef95ee 100755
--- a/tests/ssl_gtests/ssl_gtests.sh
+++ b/tests/ssl_gtests/ssl_gtests.sh
@@ -105,6 +105,8 @@ ssl_gtest_start()
return
fi
+ # Temporarily disable asserts for PKCS#11 slot leakage (Bug 1168425)
+ unset NSS_STRICT_SHUTDOWN
SSLGTESTREPORT="${SSLGTESTDIR}/report.xml"
${BINDIR}/ssl_gtest -d "${SSLGTESTDIR}" --gtest_output=xml:"${SSLGTESTREPORT}"
html_msg $? 0 "ssl_gtest run successfully"
@@ -120,6 +122,14 @@ ssl_gtest_start()
done
}
+ssl_gtest_cleanup()
+{
+ cd ${QADIR}
+ . common/cleanup.sh
+}
+
################## main #################################################
+cd "$(dirname "$0")"
ssl_gtest_init
ssl_gtest_start
+ssl_gtest_cleanup