Skip to content

Commit 0ae7eae

Browse files
committed
tests: Adjust test cases for the updated NFD
Change-Id: Ib845bfebb5a43ee54566288156b120384c72e6c7
1 parent 25e4d8f commit 0ae7eae

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

tests/unit-tests/model/ndn-block-header.t.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
/**
3-
* Copyright (c) 2011-2015 Regents of the University of California.
3+
* Copyright (c) 2011-2019 Regents of the University of California.
44
*
55
* This file is part of ndnSIM. See AUTHORS for complete list of ndnSIM authors and
66
* contributors.
@@ -21,6 +21,7 @@
2121
#include "helper/ndn-stack-helper.hpp"
2222

2323
#include <ndn-cxx/lp/packet.hpp>
24+
#include <ndn-cxx/encoding/block.hpp>
2425

2526
#include "ns3/ndnSIM/NFD/daemon/face/transport.hpp"
2627
#include "ns3/packet.h"
@@ -30,6 +31,8 @@
3031
namespace ns3 {
3132
namespace ndn {
3233

34+
using ::ndn::operator "" _block;
35+
3336
BOOST_FIXTURE_TEST_SUITE(ModelNdnBlockHeader, CleanupFixture)
3437

3538
class EnablePacketPrintingFixture
@@ -142,8 +145,8 @@ BOOST_AUTO_TEST_CASE(PrintLpPacket)
142145
BOOST_CHECK(output.is_equal("ns3::ndn::Packet (NDNLP(fragment 1 out of 2))"));
143146
}
144147

145-
::ndn::Buffer buf(10);
146-
lpPacket.set<::ndn::lp::FragmentField>(std::make_pair(buf.begin(), buf.end()));
148+
Block unknown = "8808 0000 0000 0000 0000"_block;
149+
lpPacket.set<::ndn::lp::FragmentField>(std::make_pair(unknown.begin(), unknown.end()));
147150
lpPacket.remove<::ndn::lp::FragCountField>();
148151
lpPacket.remove<::ndn::lp::FragIndexField>();
149152

tests/unit-tests/utils/tracers/ndn-app-delay-tracer.t.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ BOOST_AUTO_TEST_CASE(InstallAll)
8989

9090
BOOST_CHECK_EQUAL(buffer.str(),
9191
R"STR(Time Node AppId SeqNo Type DelayS DelayUS RetxCount HopCount
92-
0.0417968 1 0 0 LastDelay 0.0417968 41796.8 1 2
93-
0.0417968 1 0 0 FullDelay 0.0417968 41796.8 1 2
94-
2 2 0 0 LastDelay 0 0 1 0
95-
2 2 0 0 FullDelay 0 0 1 0
96-
3.0209 2 0 1 LastDelay 0.0208984 20898.4 1 1
97-
3.0209 2 0 1 FullDelay 0.0208984 20898.4 1 1
92+
0.0417744 1 0 0 LastDelay 0.0417744 41774.4 1 2
93+
0.0417744 1 0 0 FullDelay 0.0417744 41774.4 1 2
94+
2 2 0 0 LastDelay 0 0 1 1
95+
2 2 0 0 FullDelay 0 0 1 1
96+
3.02089 2 0 1 LastDelay 0.0208872 20887.2 1 1
97+
3.02089 2 0 1 FullDelay 0.0208872 20887.2 1 1
9898
)STR");
9999
}
100100

@@ -116,8 +116,8 @@ BOOST_AUTO_TEST_CASE(InstallNodeContainer)
116116

117117
BOOST_CHECK_EQUAL(buffer.str(),
118118
R"STR(Time Node AppId SeqNo Type DelayS DelayUS RetxCount HopCount
119-
0.0417968 1 0 0 LastDelay 0.0417968 41796.8 1 2
120-
0.0417968 1 0 0 FullDelay 0.0417968 41796.8 1 2
119+
0.0417744 1 0 0 LastDelay 0.0417744 41774.4 1 2
120+
0.0417744 1 0 0 FullDelay 0.0417744 41774.4 1 2
121121
)STR");
122122
}
123123

@@ -136,10 +136,10 @@ BOOST_AUTO_TEST_CASE(InstallNode)
136136

137137
BOOST_CHECK_EQUAL(buffer.str(),
138138
R"STR(Time Node AppId SeqNo Type DelayS DelayUS RetxCount HopCount
139-
2 2 0 0 LastDelay 0 0 1 0
140-
2 2 0 0 FullDelay 0 0 1 0
141-
3.0209 2 0 1 LastDelay 0.0208984 20898.4 1 1
142-
3.0209 2 0 1 FullDelay 0.0208984 20898.4 1 1
139+
2 2 0 0 LastDelay 0 0 1 1
140+
2 2 0 0 FullDelay 0 0 1 1
141+
3.02089 2 0 1 LastDelay 0.0208872 20887.2 1 1
142+
3.02089 2 0 1 FullDelay 0.0208872 20887.2 1 1
143143
)STR");
144144
}
145145

@@ -154,10 +154,10 @@ BOOST_AUTO_TEST_CASE(InstallNodeDumpStream)
154154
tracer = nullptr; // destroy tracer
155155

156156
BOOST_CHECK(output->is_equal(
157-
R"STR(2 2 0 0 LastDelay 0 0 1 0
158-
2 2 0 0 FullDelay 0 0 1 0
159-
3.0209 2 0 1 LastDelay 0.0208984 20898.4 1 1
160-
3.0209 2 0 1 FullDelay 0.0208984 20898.4 1 1
157+
R"STR(2 2 0 0 LastDelay 0 0 1 1
158+
2 2 0 0 FullDelay 0 0 1 1
159+
3.02089 2 0 1 LastDelay 0.0208872 20887.2 1 1
160+
3.02089 2 0 1 FullDelay 0.0208872 20887.2 1 1
161161
)STR"));
162162
}
163163

0 commit comments

Comments
 (0)