pit: add EndpointId field in in-record and out-record
refs: #4842
Change-Id: Id4bca4ad9c2d7c8a2fd975c0b052fb9271b6e47d
diff --git a/tests/daemon/fw/algorithm.t.cpp b/tests/daemon/fw/algorithm.t.cpp
index 8a188e6..1e482c5 100644
--- a/tests/daemon/fw/algorithm.t.cpp
+++ b/tests/daemon/fw/algorithm.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -97,15 +97,15 @@
auto face1 = make_shared<DummyFace>();
auto face2 = make_shared<DummyFace>();
- entry.insertOrUpdateInRecord(*face1, *interest);
+ entry.insertOrUpdateInRecord(*face1, 0, *interest);
BOOST_CHECK_EQUAL(canForwardToLegacy(entry, *face1), false);
BOOST_CHECK_EQUAL(canForwardToLegacy(entry, *face2), true);
- entry.insertOrUpdateInRecord(*face2, *interest);
+ entry.insertOrUpdateInRecord(*face2, 0, *interest);
BOOST_CHECK_EQUAL(canForwardToLegacy(entry, *face1), true);
BOOST_CHECK_EQUAL(canForwardToLegacy(entry, *face2), true);
- entry.insertOrUpdateOutRecord(*face1, *interest);
+ entry.insertOrUpdateOutRecord(*face1, 0, *interest);
BOOST_CHECK_EQUAL(canForwardToLegacy(entry, *face1), false);
BOOST_CHECK_EQUAL(canForwardToLegacy(entry, *face2), true);
}
@@ -125,22 +125,22 @@
BOOST_CHECK_EQUAL(findDuplicateNonce(entry0, 19004, *face2), DUPLICATE_NONCE_NONE);
pit::Entry entry1(*interest);
- entry1.insertOrUpdateInRecord(*face1, *interest);
+ entry1.insertOrUpdateInRecord(*face1, 0, *interest);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry1, 25559, *face1), DUPLICATE_NONCE_IN_SAME);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry1, 25559, *face2), DUPLICATE_NONCE_IN_OTHER);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry1, 19004, *face1), DUPLICATE_NONCE_NONE);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry1, 19004, *face2), DUPLICATE_NONCE_NONE);
pit::Entry entry2(*interest);
- entry2.insertOrUpdateOutRecord(*face1, *interest);
+ entry2.insertOrUpdateOutRecord(*face1, 0, *interest);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry2, 25559, *face1), DUPLICATE_NONCE_OUT_SAME);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry2, 25559, *face2), DUPLICATE_NONCE_OUT_OTHER);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry2, 19004, *face1), DUPLICATE_NONCE_NONE);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry2, 19004, *face2), DUPLICATE_NONCE_NONE);
pit::Entry entry3(*interest);
- entry3.insertOrUpdateInRecord(*face1, *interest);
- entry3.insertOrUpdateOutRecord(*face1, *interest);
+ entry3.insertOrUpdateInRecord(*face1, 0, *interest);
+ entry3.insertOrUpdateOutRecord(*face1, 0, *interest);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry3, 25559, *face1),
DUPLICATE_NONCE_IN_SAME | DUPLICATE_NONCE_OUT_SAME);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry3, 25559, *face2),
@@ -149,8 +149,8 @@
BOOST_CHECK_EQUAL(findDuplicateNonce(entry3, 19004, *face2), DUPLICATE_NONCE_NONE);
pit::Entry entry4(*interest);
- entry4.insertOrUpdateInRecord(*face1, *interest);
- entry4.insertOrUpdateInRecord(*face2, *interest);
+ entry4.insertOrUpdateInRecord(*face1, 0, *interest);
+ entry4.insertOrUpdateInRecord(*face2, 0, *interest);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry4, 25559, *face1),
DUPLICATE_NONCE_IN_SAME | DUPLICATE_NONCE_IN_OTHER);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry4, 25559, *face2),
@@ -159,8 +159,8 @@
BOOST_CHECK_EQUAL(findDuplicateNonce(entry4, 19004, *face2), DUPLICATE_NONCE_NONE);
pit::Entry entry5(*interest);
- entry5.insertOrUpdateOutRecord(*face1, *interest);
- entry5.insertOrUpdateOutRecord(*face2, *interest);
+ entry5.insertOrUpdateOutRecord(*face1, 0, *interest);
+ entry5.insertOrUpdateOutRecord(*face2, 0, *interest);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry5, 25559, *face1),
DUPLICATE_NONCE_OUT_SAME | DUPLICATE_NONCE_OUT_OTHER);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry5, 25559, *face2),
@@ -182,15 +182,15 @@
BOOST_CHECK_EQUAL(hasPendingOutRecords(entry), false);
// Interest-Data
- entry.insertOrUpdateOutRecord(*face1, *interest);
+ entry.insertOrUpdateOutRecord(*face1, 0, *interest);
BOOST_CHECK_EQUAL(hasPendingOutRecords(entry), true);
- entry.deleteOutRecord(*face1);
+ entry.deleteOutRecord(*face1, 0);
BOOST_CHECK_EQUAL(hasPendingOutRecords(entry), false);
// Interest-Nack
- entry.insertOrUpdateOutRecord(*face2, *interest);
+ entry.insertOrUpdateOutRecord(*face2, 0, *interest);
BOOST_CHECK_EQUAL(hasPendingOutRecords(entry), true);
- pit::OutRecordCollection::iterator outR = entry.getOutRecord(*face2);
+ pit::OutRecordCollection::iterator outR = entry.getOutRecord(*face2, 0);
BOOST_REQUIRE(outR != entry.out_end());
lp::Nack nack = makeNack("ndn:/totzXG0d", 29321, lp::NackReason::DUPLICATE);
bool isNackAccepted = outR->setIncomingNack(nack); // Nack arrival
@@ -198,7 +198,7 @@
BOOST_CHECK_EQUAL(hasPendingOutRecords(entry), false);
// Interest-timeout
- entry.insertOrUpdateOutRecord(*face3, *interest);
+ entry.insertOrUpdateOutRecord(*face3, 0, *interest);
BOOST_CHECK_EQUAL(hasPendingOutRecords(entry), true);
this->advanceClocks(ndn::DEFAULT_INTEREST_LIFETIME, 2);
BOOST_CHECK_EQUAL(hasPendingOutRecords(entry), false);
@@ -214,12 +214,12 @@
time::steady_clock::TimePoint before = time::steady_clock::now();
- entry.insertOrUpdateOutRecord(*face1, *interest);
+ entry.insertOrUpdateOutRecord(*face1, 0, *interest);
this->advanceClocks(time::milliseconds(1000));
BOOST_CHECK_EQUAL(getLastOutgoing(entry), before);
- entry.insertOrUpdateOutRecord(*face2, *interest);
+ entry.insertOrUpdateOutRecord(*face2, 0, *interest);
BOOST_CHECK_EQUAL(getLastOutgoing(entry), time::steady_clock::now());
}