Skip to content

Commit

Permalink
tests: Adjust test cases for the updated NFD
Browse files Browse the repository at this point in the history
Change-Id: Ib845bfebb5a43ee54566288156b120384c72e6c7
  • Loading branch information
cawka committed May 31, 2020
1 parent 25e4d8f commit 0ae7eae
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
9 changes: 6 additions & 3 deletions tests/unit-tests/model/ndn-block-header.t.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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"
Expand All @@ -30,6 +31,8 @@
namespace ns3 {
namespace ndn {

using ::ndn::operator "" _block;

BOOST_FIXTURE_TEST_SUITE(ModelNdnBlockHeader, CleanupFixture)

class EnablePacketPrintingFixture
Expand Down Expand Up @@ -142,8 +145,8 @@ BOOST_AUTO_TEST_CASE(PrintLpPacket)
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>();

Expand Down
32 changes: 16 additions & 16 deletions tests/unit-tests/utils/tracers/ndn-app-delay-tracer.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ BOOST_AUTO_TEST_CASE(InstallAll)

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");
}

Expand All @@ -116,8 +116,8 @@ BOOST_AUTO_TEST_CASE(InstallNodeContainer)

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");
}

Expand All @@ -136,10 +136,10 @@ BOOST_AUTO_TEST_CASE(InstallNode)

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");
}

Expand All @@ -154,10 +154,10 @@ BOOST_AUTO_TEST_CASE(InstallNodeDumpStream)
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"));
}

Expand Down

0 comments on commit 0ae7eae

Please sign in to comment.