external_tests/README
author Nicholas Nethercote <nnethercote@mozilla.com>
Tue, 18 Nov 2014 15:16:24 -0800
changeset 11309 f9bac028f79a6b2129c561137f1d4312c981cedd
parent 11248 2f4676c16d52cb792e3594652271d0b9624eaaca
child 11431 1865635f5df5b827623371aae1b1d7c4cea52657
permissions -rw-r--r--
Bug 1095307 - Clean up nssPKIX509_GetIssuerAndSerialFromDER(). r=relyea. This patch: - Removes the two static issuer_and_serial_from_encoding() functions. - Rewrites nssPKIX509_GetIssuerAndSerialFromDER() to be almost identical to the issuer_and_serial_from_encoding() from pkistore.c. This new version avoids unnecessary heap allocations (and so doesn't need an |arena| argument), obtains the issuer and serial in the order suggested by the function name, and is more readable than the old version. - Tweaks nssTrustDomain_FindCertificateByEncodedCertificate() to be more like nssTrustDomain_GetCertByDERFromCache() and nssCertificateStore_FindCertificateByEncodedCertificate(), which are the other two functions that now call nssPKIX509_GetIssuerAndSerialFromDER().

GTest-based Unit Tests

This directory contains GTest-based unit tests for NSS.

Currently, these are only loopback-type tests of libsssl,
but could be expanded to other types of tests. To make these
work do:

- Set NSS_BUILD_GTESTS=1 before starting your build

- cd tests/

- Set NSS_TESTS=ssl_gtests and NSS_CYCLES=standard

- run ./all.sh

This will run the certutil tests (generating a test db) and
will finalize with a call to the ssl_gtest

You should be able to run the unit tests manually as:

  ssl_gtest -d ${SSLGTESTDIR}

Where $SSLGTESTDIR the directory created by ./all.sh or a manually
created directory with a database containing a certificate called
server (with its private keys)


There is a very trivial set of tests that demonstrate some
of the features.