[Nfd-dev] how does advance clock works

Muktadir R Chowdhury (mrchwdhr) mrchwdhr at memphis.edu
Thu Dec 15 11:07:58 PST 2016


Hi,

Here is the definition of advanceClock in NLSR: https://github.com/named-data/NLSR/blob/master/tests/test-common.hpp#L66.


We are trying to write a unit-test for Fib::scheduleEntryRefresh() (which is currently under review in gerrit) at line 449 in  https://gerrit.named-data.net/#/c/2011/8/src/route/fib.cpp.

The method calls Fib::refreshEntry(), which actually renews the next hops, and at the end again schedules another refresh by calling Fib::scheduleEntryRefresh().


The unit-test is at line 310 in https://gerrit.named-data.net/#/c/2011/8/tests/test-fib.cpp

As I commented on gerrit, if I don't do advanceClock() the scheduled refresh does not occur. But if I advanceClock() then it gets in an infinite loop, because Fib::scheduleEntryRefresh() and Fib::refreshEntry() calls each other recursively. This is how I advance clock

this->advanceClocks(ndn::time::milliseconds(1));

Am I doing anything wrong?


Muktadir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/nfd-dev/attachments/20161215/f50a0fa4/attachment.html>


More information about the Nfd-dev mailing list