catchunks: pass versioned name to onDiscoverySuccess signal
refs: #4556
Change-Id: I599bafcf70647bd806236f87f24d7a22f73a3505
diff --git a/tests/chunks/consumer.t.cpp b/tests/chunks/consumer.t.cpp
index ebedd61..f6d3e8a 100644
--- a/tests/chunks/consumer.t.cpp
+++ b/tests/chunks/consumer.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2016-2018, Regents of the University of California,
+ * Copyright (c) 2016-2019, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -157,7 +157,10 @@
void
handleData(const Interest& interest, const Data& data) final
{
- this->emitSignal(onDiscoverySuccess, data);
+ if (!data.getName().empty() && data.getName()[-1].isVersion())
+ this->emitSignal(onDiscoverySuccess, data.getName());
+ else
+ this->emitSignal(onDiscoveryFailure, "Invalid versioned name");
}
public:
@@ -210,7 +213,8 @@
this->advanceClocks(io, time::nanoseconds(1));
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
- auto data = makeData(prefix.appendSegment(0));
+ // this Data packet answers the discovery Interest, so it must end with a version number
+ auto data = makeData(prefix.appendVersion(0));
face.receive(*data);
this->advanceClocks(io, time::nanoseconds(1));