tests: stop using deprecated Buffer::buf()
Change-Id: I48b7672098cfe57ccb470a247eed0c80e24cfffe
diff --git a/tests/daemon/face/datagram-transport.t.cpp b/tests/daemon/face/datagram-transport.t.cpp
index 535ea43..d6286eb 100644
--- a/tests/daemon/face/datagram-transport.t.cpp
+++ b/tests/daemon/face/datagram-transport.t.cpp
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
* Copyright (c) 2014-2017, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
@@ -76,10 +76,7 @@
SKIP_IF_IP_UNAVAILABLE(this->defaultAddr);
this->initialize(this->defaultAddr);
- std::vector<uint8_t> buf{
- 0x05, 0x03, 0x00, 0x01,
- };
- this->remoteWrite(buf);
+ this->remoteWrite({0x05, 0x03, 0x00, 0x01});
BOOST_CHECK_EQUAL(this->transport->getCounters().nInPackets, 0);
BOOST_CHECK_EQUAL(this->transport->getCounters().nInBytes, 0);
@@ -95,8 +92,8 @@
Block pkt1 = ndn::encoding::makeStringBlock(300, "hello");
Block pkt2 = ndn::encoding::makeStringBlock(301, "world");
ndn::Buffer buf(pkt1.size() + pkt2.size());
- std::copy(pkt1.begin(), pkt1.end(), buf.buf());
- std::copy(pkt2.begin(), pkt2.end(), buf.buf() + pkt1.size());
+ std::copy(pkt1.begin(), pkt1.end(), buf.begin());
+ std::copy(pkt2.begin(), pkt2.end(), buf.begin() + pkt1.size());
this->remoteWrite(buf);
diff --git a/tests/daemon/face/lp-reliability.t.cpp b/tests/daemon/face/lp-reliability.t.cpp
index 5909737..16fb88f 100644
--- a/tests/daemon/face/lp-reliability.t.cpp
+++ b/tests/daemon/face/lp-reliability.t.cpp
@@ -134,7 +134,7 @@
lp::Packet pkt;
ndn::Buffer buf(payloadSize);
- std::memcpy(buf.buf(), &pktNo, sizeof(pktNo));
+ std::memcpy(buf.data(), &pktNo, sizeof(pktNo));
pkt.set<lp::FragmentField>(make_pair(buf.cbegin(), buf.cend()));
return pkt;
}
diff --git a/tests/daemon/face/stream-transport.t.cpp b/tests/daemon/face/stream-transport.t.cpp
index ad8d60c..81044d1 100644
--- a/tests/daemon/face/stream-transport.t.cpp
+++ b/tests/daemon/face/stream-transport.t.cpp
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
* Copyright (c) 2014-2017, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
@@ -111,8 +111,8 @@
Block pkt1 = ndn::encoding::makeStringBlock(300, "hello");
Block pkt2 = ndn::encoding::makeStringBlock(301, "world");
ndn::Buffer buf(pkt1.size() + pkt2.size());
- std::copy(pkt1.begin(), pkt1.end(), buf.buf());
- std::copy(pkt2.begin(), pkt2.end(), buf.buf() + pkt1.size());
+ std::copy(pkt1.begin(), pkt1.end(), buf.begin());
+ std::copy(pkt2.begin(), pkt2.end(), buf.begin() + pkt1.size());
this->remoteWrite(buf);