Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 1214390 - Fixing compilation errors on Windows, r=ekr,wtc
--HG--
extra : amend_source : 9bce5b9ad34136da3fbf582a79f4731f14a5038a
  • Loading branch information
martinthomson committed Oct 19, 2015
1 parent 5a6c8f7 commit 49f1217
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 18 deletions.
4 changes: 3 additions & 1 deletion Makefile
Expand Up @@ -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) #
Expand Down
3 changes: 2 additions & 1 deletion coreconf/WIN32.mk
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion external_tests/ssl_gtest/Makefile
Expand Up @@ -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
Expand All @@ -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
3 changes: 0 additions & 3 deletions external_tests/ssl_gtest/ssl_gtest.cc
Expand Up @@ -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;
Expand Down
14 changes: 7 additions & 7 deletions external_tests/ssl_gtest/tls_agent.cc
Expand Up @@ -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);
Expand Down Expand Up @@ -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_;
}

Expand Down
6 changes: 1 addition & 5 deletions manifest.mn
Expand Up @@ -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
10 changes: 10 additions & 0 deletions tests/ssl_gtests/ssl_gtests.sh
Expand Up @@ -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"
Expand All @@ -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

0 comments on commit 49f1217

Please sign in to comment.