tests: Adjust test cases for the updated NFD
Change-Id: Ib845bfebb5a43ee54566288156b120384c72e6c7
diff --git a/tests/unit-tests/model/ndn-block-header.t.cpp b/tests/unit-tests/model/ndn-block-header.t.cpp
index 5dc65f1..474f7e5 100644
--- a/tests/unit-tests/model/ndn-block-header.t.cpp
+++ b/tests/unit-tests/model/ndn-block-header.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2011-2015 Regents of the University of California.
+ * Copyright (c) 2011-2019 Regents of the University of California.
*
* This file is part of ndnSIM. See AUTHORS for complete list of ndnSIM authors and
* contributors.
@@ -21,6 +21,7 @@
#include "helper/ndn-stack-helper.hpp"
#include <ndn-cxx/lp/packet.hpp>
+#include <ndn-cxx/encoding/block.hpp>
#include "ns3/ndnSIM/NFD/daemon/face/transport.hpp"
#include "ns3/packet.h"
@@ -30,6 +31,8 @@
namespace ns3 {
namespace ndn {
+using ::ndn::operator "" _block;
+
BOOST_FIXTURE_TEST_SUITE(ModelNdnBlockHeader, CleanupFixture)
class EnablePacketPrintingFixture
@@ -142,8 +145,8 @@
BOOST_CHECK(output.is_equal("ns3::ndn::Packet (NDNLP(fragment 1 out of 2))"));
}
- ::ndn::Buffer buf(10);
- lpPacket.set<::ndn::lp::FragmentField>(std::make_pair(buf.begin(), buf.end()));
+ Block unknown = "8808 0000 0000 0000 0000"_block;
+ lpPacket.set<::ndn::lp::FragmentField>(std::make_pair(unknown.begin(), unknown.end()));
lpPacket.remove<::ndn::lp::FragCountField>();
lpPacket.remove<::ndn::lp::FragIndexField>();
diff --git a/tests/unit-tests/utils/tracers/ndn-app-delay-tracer.t.cpp b/tests/unit-tests/utils/tracers/ndn-app-delay-tracer.t.cpp
index 7150139..3e8804c 100644
--- a/tests/unit-tests/utils/tracers/ndn-app-delay-tracer.t.cpp
+++ b/tests/unit-tests/utils/tracers/ndn-app-delay-tracer.t.cpp
@@ -89,12 +89,12 @@
BOOST_CHECK_EQUAL(buffer.str(),
R"STR(Time Node AppId SeqNo Type DelayS DelayUS RetxCount HopCount
-0.0417968 1 0 0 LastDelay 0.0417968 41796.8 1 2
-0.0417968 1 0 0 FullDelay 0.0417968 41796.8 1 2
-2 2 0 0 LastDelay 0 0 1 0
-2 2 0 0 FullDelay 0 0 1 0
-3.0209 2 0 1 LastDelay 0.0208984 20898.4 1 1
-3.0209 2 0 1 FullDelay 0.0208984 20898.4 1 1
+0.0417744 1 0 0 LastDelay 0.0417744 41774.4 1 2
+0.0417744 1 0 0 FullDelay 0.0417744 41774.4 1 2
+2 2 0 0 LastDelay 0 0 1 1
+2 2 0 0 FullDelay 0 0 1 1
+3.02089 2 0 1 LastDelay 0.0208872 20887.2 1 1
+3.02089 2 0 1 FullDelay 0.0208872 20887.2 1 1
)STR");
}
@@ -116,8 +116,8 @@
BOOST_CHECK_EQUAL(buffer.str(),
R"STR(Time Node AppId SeqNo Type DelayS DelayUS RetxCount HopCount
-0.0417968 1 0 0 LastDelay 0.0417968 41796.8 1 2
-0.0417968 1 0 0 FullDelay 0.0417968 41796.8 1 2
+0.0417744 1 0 0 LastDelay 0.0417744 41774.4 1 2
+0.0417744 1 0 0 FullDelay 0.0417744 41774.4 1 2
)STR");
}
@@ -136,10 +136,10 @@
BOOST_CHECK_EQUAL(buffer.str(),
R"STR(Time Node AppId SeqNo Type DelayS DelayUS RetxCount HopCount
-2 2 0 0 LastDelay 0 0 1 0
-2 2 0 0 FullDelay 0 0 1 0
-3.0209 2 0 1 LastDelay 0.0208984 20898.4 1 1
-3.0209 2 0 1 FullDelay 0.0208984 20898.4 1 1
+2 2 0 0 LastDelay 0 0 1 1
+2 2 0 0 FullDelay 0 0 1 1
+3.02089 2 0 1 LastDelay 0.0208872 20887.2 1 1
+3.02089 2 0 1 FullDelay 0.0208872 20887.2 1 1
)STR");
}
@@ -154,10 +154,10 @@
tracer = nullptr; // destroy tracer
BOOST_CHECK(output->is_equal(
- R"STR(2 2 0 0 LastDelay 0 0 1 0
-2 2 0 0 FullDelay 0 0 1 0
-3.0209 2 0 1 LastDelay 0.0208984 20898.4 1 1
-3.0209 2 0 1 FullDelay 0.0208984 20898.4 1 1
+ R"STR(2 2 0 0 LastDelay 0 0 1 1
+2 2 0 0 FullDelay 0 0 1 1
+3.02089 2 0 1 LastDelay 0.0208872 20887.2 1 1
+3.02089 2 0 1 FullDelay 0.0208872 20887.2 1 1
)STR"));
}