ci: set ASan's detect_invalid_pointer_pairs to 2

Change-Id: Ibc9a4bd447a8ccebbf864c2da6c279ef5e272739
diff --git a/.jenkins.d/20-tests.sh b/.jenkins.d/20-tests.sh
index 286e95a..eda93c7 100755
--- a/.jenkins.d/20-tests.sh
+++ b/.jenkins.d/20-tests.sh
@@ -31,7 +31,7 @@
 ASAN_OPTIONS+=":detect_stack_use_after_return=1"
 ASAN_OPTIONS+=":strict_init_order=1"
 ASAN_OPTIONS+=":strict_string_checks=1"
-ASAN_OPTIONS+=":detect_invalid_pointer_pairs=1"
+ASAN_OPTIONS+=":detect_invalid_pointer_pairs=2"
 ASAN_OPTIONS+=":detect_container_overflow=0"
 ASAN_OPTIONS+=":detect_leaks=0"
 ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
diff --git a/tests/daemon/face/lp-reliability.t.cpp b/tests/daemon/face/lp-reliability.t.cpp
index 1880074..99223df 100644
--- a/tests/daemon/face/lp-reliability.t.cpp
+++ b/tests/daemon/face/lp-reliability.t.cpp
@@ -120,14 +120,12 @@
 
   /** \brief make an LpPacket with fragment of specified size
    *  \param pktNum packet identifier, which can be extracted with \p getPktNum
-   *  \param payloadSize total payload size; if this is less than 4, 4 will be used
+   *  \param payloadSize total payload size; must be >= 4 and <= 255
    */
   static lp::Packet
   makeFrag(uint32_t pktNum, size_t payloadSize = 4)
   {
-    payloadSize = std::max(payloadSize, static_cast<size_t>(4));
-    BOOST_ASSERT(payloadSize <= 255);
-
+    BOOST_ASSERT(payloadSize >= 4 && payloadSize <= 255);
     lp::Packet pkt;
     ndn::Buffer buf(payloadSize);
     std::memcpy(buf.data(), &pktNum, sizeof(pktNum));
@@ -141,8 +139,7 @@
   static uint32_t
   getPktNum(const lp::Packet& pkt)
   {
-    BOOST_ASSERT(pkt.has<lp::FragmentField>());
-
+    BOOST_REQUIRE(pkt.has<lp::FragmentField>());
     ndn::Buffer::const_iterator begin, end;
     std::tie(begin, end) = pkt.get<lp::FragmentField>();
     if (std::distance(begin, end) < 4) {
@@ -621,7 +618,6 @@
   lp::Packet sentRetxPkt(transport->sentPackets.back().packet);
   BOOST_REQUIRE(sentRetxPkt.has<lp::TxSequenceField>());
   BOOST_CHECK_EQUAL(sentRetxPkt.get<lp::TxSequenceField>(), 4);
-  BOOST_REQUIRE(sentRetxPkt.has<lp::FragmentField>());
   BOOST_CHECK_EQUAL(getPktNum(sentRetxPkt), 1);
   BOOST_CHECK_EQUAL(linkService->getCounters().nAcknowledged, 3);
   BOOST_CHECK_EQUAL(linkService->getCounters().nRetransmitted, 0);
diff --git a/tests/daemon/mgmt/face-manager.t.cpp b/tests/daemon/mgmt/face-manager.t.cpp
index 0930374..439c220 100644
--- a/tests/daemon/mgmt/face-manager.t.cpp
+++ b/tests/daemon/mgmt/face-manager.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2020,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -96,6 +96,7 @@
 
     advanceClocks(1_ms, 10); // wait for notification posted
     if (flags & REMOVE_LAST_NOTIFICATION) {
+      BOOST_REQUIRE(!m_responses.empty());
       m_responses.pop_back();
     }
 
diff --git a/tests/tools/ndn-autoconfig-server/program.t.cpp b/tests/tools/ndn-autoconfig-server/program.t.cpp
index 31731f8..88488a1 100644
--- a/tests/tools/ndn-autoconfig-server/program.t.cpp
+++ b/tests/tools/ndn-autoconfig-server/program.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2020,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -39,22 +39,17 @@
 
 class AutoconfigServerFixture : public ::nfd::tests::KeyChainFixture
 {
-public:
-  AutoconfigServerFixture()
-    : face({true, true})
-  {
-  }
-
+protected:
   void
   initialize(const Options& options)
   {
     program = make_unique<Program>(options, face, m_keyChain);
-    face.processEvents(500_ms);
+    face.processEvents(1_s);
     face.sentInterests.clear();
   }
 
 protected:
-  util::DummyClientFace face;
+  util::DummyClientFace face{{true, true}};
   unique_ptr<Program> program;
 };
 
@@ -71,7 +66,7 @@
   interest.setCanBePrefix(true);
   interest.setMustBeFresh(true);
   face.receive(interest);
-  face.processEvents(500_ms);
+  face.processEvents(1_s);
 
   BOOST_REQUIRE_EQUAL(face.sentData.size(), 1);
   const Name& dataName = face.sentData[0].getName();
@@ -83,7 +78,7 @@
   Interest interest2(Name(interest.getName()).appendVersion(dataName.at(-1).toVersion() - 1));
   interest2.setCanBePrefix(false);
   face.receive(interest2);
-  face.processEvents(500_ms);
+  face.processEvents(1_s);
   BOOST_CHECK_EQUAL(face.sentData.size(), 1);
 }
 
@@ -109,12 +104,11 @@
     BOOST_CHECK(dataName.at(-2).isVersion());
     BOOST_CHECK(dataName.at(-1).isSegment());
   });
-  fetcher->onError.connect([] (uint32_t code, const std::string& msg) {
-    BOOST_FAIL(msg);
-  });
+  fetcher->onError.connect([] (auto, const auto& msg) { BOOST_FAIL(msg); });
+
   bool isComplete = false;
-  fetcher->onComplete.connect([&isComplete, nRoutablePrefixes, options] (ConstBufferPtr buffer) {
-    Block payload(tlv::Content, buffer);
+  fetcher->onComplete.connect([&] (auto buffer) {
+    Block payload(tlv::Content, std::move(buffer));
     payload.parse();
     BOOST_REQUIRE_EQUAL(payload.elements_size(), nRoutablePrefixes);
     for (size_t i = 0; i < nRoutablePrefixes; ++i) {
@@ -123,7 +117,7 @@
     isComplete = true;
   });
 
-  face.processEvents(100_ms, 2000);
+  face.processEvents(1_s);
   BOOST_CHECK(isComplete);
 }
 
@@ -136,7 +130,7 @@
   Interest interest("/localhop/nfd/rib/routable-prefixes");
   interest.setCanBePrefix(true);
   face.receive(interest);
-  face.processEvents(500_ms);
+  face.processEvents(1_s);
   BOOST_CHECK_EQUAL(face.sentData.size(), 0);
 }