summaryrefslogtreecommitdiff
path: root/gtests/common
diff options
context:
space:
mode:
authorTim Taubert <ttaubert@mozilla.com>2017-02-10 16:23:22 +0100
committerTim Taubert <ttaubert@mozilla.com>2017-02-10 16:23:22 +0100
commitff78450919bdcbc3444ca02642b45d24859ea7ff (patch)
tree4b847121aa2fce01604e7a3fb30b63851c1c2f72 /gtests/common
parent2df7bf838163ff4bd104dc77f6cd375579decd27 (diff)
downloadnss-hg-ff78450919bdcbc3444ca02642b45d24859ea7ff.tar.gz
Bug 1330557 - Add basic TLS client fuzzer r=mt,franziskus
Differential Revision: https://nss-review.dev.mozaws.net/D145
Diffstat (limited to 'gtests/common')
-rw-r--r--gtests/common/gtest.gypi5
-rw-r--r--gtests/common/manifest.mn3
-rw-r--r--gtests/common/scoped_ptrs.h63
3 files changed, 7 insertions, 64 deletions
diff --git a/gtests/common/gtest.gypi b/gtests/common/gtest.gypi
index 2a3163426..e0ffc86e2 100644
--- a/gtests/common/gtest.gypi
+++ b/gtests/common/gtest.gypi
@@ -3,6 +3,11 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
{
'target_defaults': {
+ 'include_dirs': [
+ '<(DEPTH)/gtests/google_test/gtest/include',
+ '<(DEPTH)/gtests/common',
+ '<(DEPTH)/cpputil',
+ ],
'cflags': [
'-Wsign-compare',
],
diff --git a/gtests/common/manifest.mn b/gtests/common/manifest.mn
index 9834e42a0..a40989bf7 100644
--- a/gtests/common/manifest.mn
+++ b/gtests/common/manifest.mn
@@ -11,7 +11,8 @@ CPPSRCS = \
$(NULL)
INCLUDES += -I$(CORE_DEPTH)/gtests/google_test/gtest/include \
- -I$(CORE_DEPTH)/gtests/common
+ -I$(CORE_DEPTH)/gtests/common \
+ -I$(CORE_DEPTH)/cpputil
REQUIRES = gtest
diff --git a/gtests/common/scoped_ptrs.h b/gtests/common/scoped_ptrs.h
deleted file mode 100644
index 4707393ad..000000000
--- a/gtests/common/scoped_ptrs.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef scoped_ptrs_h__
-#define scoped_ptrs_h__
-
-#include <memory>
-#include "cert.h"
-#include "keyhi.h"
-#include "pk11pub.h"
-
-namespace nss_test {
-
-struct ScopedDelete {
- void operator()(CERTCertificate* cert) { CERT_DestroyCertificate(cert); }
- void operator()(CERTCertificateList* list) {
- CERT_DestroyCertificateList(list);
- }
- void operator()(CERTCertList* list) { CERT_DestroyCertList(list); }
- void operator()(CERTSubjectPublicKeyInfo* spki) {
- SECKEY_DestroySubjectPublicKeyInfo(spki);
- }
- void operator()(PK11SlotInfo* slot) { PK11_FreeSlot(slot); }
- void operator()(PK11SymKey* key) { PK11_FreeSymKey(key); }
- void operator()(PRFileDesc* fd) { PR_Close(fd); }
- void operator()(SECAlgorithmID* id) { SECOID_DestroyAlgorithmID(id, true); }
- void operator()(SECItem* item) { SECITEM_FreeItem(item, true); }
- void operator()(SECKEYPublicKey* key) { SECKEY_DestroyPublicKey(key); }
- void operator()(SECKEYPrivateKey* key) { SECKEY_DestroyPrivateKey(key); }
-};
-
-template <class T>
-struct ScopedMaybeDelete {
- void operator()(T* ptr) {
- if (ptr) {
- ScopedDelete del;
- del(ptr);
- }
- }
-};
-
-#define SCOPED(x) typedef std::unique_ptr<x, ScopedMaybeDelete<x> > Scoped##x
-
-SCOPED(CERTCertificate);
-SCOPED(CERTCertificateList);
-SCOPED(CERTCertList);
-SCOPED(CERTSubjectPublicKeyInfo);
-SCOPED(PK11SlotInfo);
-SCOPED(PK11SymKey);
-SCOPED(PRFileDesc);
-SCOPED(SECAlgorithmID);
-SCOPED(SECItem);
-SCOPED(SECKEYPublicKey);
-SCOPED(SECKEYPrivateKey);
-
-#undef SCOPED
-
-} // namespace nss_test
-
-#endif