blob: ca3bff5d70fc24d0623e6bbc46026b66fbd70a7b [file] [log] [blame]
Jiewen Tan99135962014-09-20 02:18:53 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Spyridon Mastorakis429634f2015-02-19 17:35:33 -08003 * Copyright (c) 2013-2015 Regents of the University of California,
4 * Arizona Board of Regents,
5 * Colorado State University,
6 * University Pierre & Marie Curie, Sorbonne University,
7 * Washington University in St. Louis,
8 * Beijing Institute of Technology
Jiewen Tan99135962014-09-20 02:18:53 -07009 *
10 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
11 *
12 * ndn-cxx library is free software: you can redistribute it and/or modify it under the
13 * terms of the GNU Lesser General Public License as published by the Free Software
14 * Foundation, either version 3 of the License, or (at your option) any later version.
15 *
16 * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
17 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
18 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
19 *
20 * You should have received copies of the GNU General Public License and GNU Lesser
21 * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
22 * <http://www.gnu.org/licenses/>.
23 *
24 * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
Spyridon Mastorakis429634f2015-02-19 17:35:33 -080025 */
Jiewen Tan99135962014-09-20 02:18:53 -070026
27#ifndef NDN_TESTS_UNIT_TESTS_MAKE_INTEREST_DATA_HPP
28#define NDN_TESTS_UNIT_TESTS_MAKE_INTEREST_DATA_HPP
29
30#include "boost-test.hpp"
31
32#include "security/key-chain.hpp"
33
34namespace ndn {
35namespace util {
36
37inline shared_ptr<Interest>
38makeInterest(const Name& name)
39{
40 return make_shared<Interest>(name);
41}
42
43inline shared_ptr<Data>
44signData(const shared_ptr<Data>& data)
45{
46 ndn::SignatureSha256WithRsa fakeSignature;
Alexander Afanasyevd5c48e02015-06-24 11:58:14 -070047 fakeSignature.setValue(makeEmptyBlock(tlv::SignatureValue));
Jiewen Tan99135962014-09-20 02:18:53 -070048 data->setSignature(fakeSignature);
49 data->wireEncode();
50
51 return data;
52}
53
54inline shared_ptr<Data>
55makeData(const Name& name)
56{
57 shared_ptr<Data> data = make_shared<Data>(name);
58
59 return signData(data);
60}
61
62} // namespace util
Jiewen Tan99135962014-09-20 02:18:53 -070063} // namespace ndn
64
65#endif // NDN_TESTS_UNIT_TESTS_MAKE_INTEREST_DATA_HPP