tests: Enable isolation of KeyChain during run of unit/integrated tests
Change-Id: Ia136e4bb074c14e8d824f563594cbc0ad7592c3b
Refs: #3655
diff --git a/tests/unit-tests/data.t.cpp b/tests/unit-tests/data.t.cpp
index e243416..19b3493 100644
--- a/tests/unit-tests/data.t.cpp
+++ b/tests/unit-tests/data.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -25,6 +25,7 @@
#include "encoding/buffer-stream.hpp"
#include "boost-test.hpp"
+#include "identity-management-fixture.hpp"
namespace ndn {
namespace tests {
@@ -315,29 +316,7 @@
"Signature: (type: 1, value_length: 128)\n");
}
-class DataIdentityFixture
-{
-public:
- DataIdentityFixture()
- : identity("/TestData")
- {
- identity.appendVersion();
-
- BOOST_REQUIRE_NO_THROW(certName = keyChain.createIdentity(identity));
- }
-
- ~DataIdentityFixture()
- {
- BOOST_CHECK_NO_THROW(keyChain.deleteIdentity(identity));
- }
-
-public:
- KeyChain keyChain;
- Name identity;
- Name certName;
-};
-
-BOOST_FIXTURE_TEST_CASE(FullName, DataIdentityFixture)
+BOOST_FIXTURE_TEST_CASE(FullName, IdentityManagementFixture)
{
// Encoding pipeline
@@ -349,7 +328,7 @@
BOOST_CHECK_THROW(d.getFullName(), Data::Error);
- keyChain.sign(d, security::SigningInfo(security::SigningInfo::SIGNER_TYPE_CERT, certName));
+ m_keyChain.sign(d);
Name fullName;
BOOST_REQUIRE_NO_THROW(fullName = d.getFullName());