diff --git a/tests/chunks/consumer.t.cpp b/tests/chunks/consumer.t.cpp
index b1231dc..741ee03 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-2023, Regents of the University of California,
+ * Copyright (c) 2016-2024, Regents of the University of California,
  *                          Colorado State University,
  *                          University Pierre & Marie Curie, Sorbonne University.
  *
@@ -99,7 +99,7 @@
   Consumer cons(security::getAcceptAllValidator(), output);
 
   auto interest = makeInterest(name, true);
-  std::vector<shared_ptr<Data>> dataStore;
+  std::vector<std::shared_ptr<Data>> dataStore;
 
   for (size_t i = 0; i < testStrings.size(); ++i) {
     auto data = makeData(Name(name).appendVersion(1).appendSegment(i));
@@ -153,8 +153,8 @@
   Consumer consumer(security::getAcceptAllValidator());
 
   Name prefix = Name("/ndn/chunks/test").appendVersion(1);
-  auto discover = make_unique<DiscoverVersion>(face, prefix, options);
-  auto pipeline = make_unique<PipelineInterestsDummy>(face, options);
+  auto discover = std::make_unique<DiscoverVersion>(face, prefix, options);
+  auto pipeline = std::make_unique<PipelineInterestsDummy>(face, options);
   auto pipelinePtr = pipeline.get();
 
   BOOST_CHECK_EQUAL(pipelinePtr->isPipelineRunning, false);
diff --git a/tests/chunks/discover-version.t.cpp b/tests/chunks/discover-version.t.cpp
index 01e360e..6b429b8 100644
--- a/tests/chunks/discover-version.t.cpp
+++ b/tests/chunks/discover-version.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2016-2023, Regents of the University of California,
+ * Copyright (c) 2016-2024, Regents of the University of California,
  *                          Colorado State University,
  *                          University Pierre & Marie Curie, Sorbonne University.
  *
@@ -42,7 +42,7 @@
   void
   run(const Name& prefix)
   {
-    discover = make_unique<DiscoverVersion>(face, prefix, opt);
+    discover = std::make_unique<DiscoverVersion>(face, prefix, opt);
     discover->onDiscoverySuccess.connect([this] (const Name& versionedName) {
       isDiscoveryFinished = true;
       discoveredName = versionedName;
@@ -62,7 +62,7 @@
   const uint64_t version = 1449227841747;
   DummyClientFace face{m_io};
   Options opt;
-  unique_ptr<DiscoverVersion> discover;
+  std::unique_ptr<DiscoverVersion> discover;
   std::optional<Name> discoveredName;
   std::optional<uint64_t> discoveredVersion;
   bool isDiscoveryFinished = false;
diff --git a/tests/chunks/pipeline-interests-aimd.t.cpp b/tests/chunks/pipeline-interests-aimd.t.cpp
index 12eeaa5..4688ee4 100644
--- a/tests/chunks/pipeline-interests-aimd.t.cpp
+++ b/tests/chunks/pipeline-interests-aimd.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2016-2022, Regents of the University of California,
+ * Copyright (c) 2016-2024, Regents of the University of California,
  *                          Colorado State University,
  *                          University Pierre & Marie Curie, Sorbonne University.
  *
@@ -29,6 +29,8 @@
 
 #include "pipeline-interests-fixture.hpp"
 
+#include <cmath>
+
 namespace ndn::chunks::tests {
 
 using namespace ndn::tests;
@@ -45,16 +47,16 @@
   void
   createPipeline()
   {
-    auto pline = make_unique<PipelineInterestsAimd>(face, rttEstimator, opt);
+    auto pline = std::make_unique<PipelineInterestsAimd>(face, rttEstimator, opt);
     pipeline = pline.get();
     setPipeline(std::move(pline));
   }
 
 private:
-  static shared_ptr<RttEstimatorWithStats::Options>
+  static std::shared_ptr<RttEstimatorWithStats::Options>
   makeRttEstimatorOptions()
   {
-    auto rttOptions = make_shared<RttEstimatorWithStats::Options>();
+    auto rttOptions = std::make_shared<RttEstimatorWithStats::Options>();
     rttOptions->alpha = 0.125;
     rttOptions->beta = 0.25;
     rttOptions->k = 4;
@@ -118,7 +120,7 @@
   for (uint64_t i = pipeline->m_ssthresh; i < nDataSegments - 1; ++i) { // congestion avoidance
     face.receive(*makeDataWithSegment(i));
     advanceClocks(time::nanoseconds(1));
-    BOOST_CHECK_CLOSE(pipeline->m_cwnd - preCwnd, opt.aiStep / floor(preCwnd), MARGIN);
+    BOOST_CHECK_CLOSE(pipeline->m_cwnd - preCwnd, opt.aiStep / std::floor(preCwnd), MARGIN);
     preCwnd = pipeline->m_cwnd;
   }
 
diff --git a/tests/chunks/pipeline-interests-cubic.t.cpp b/tests/chunks/pipeline-interests-cubic.t.cpp
index d84cce5..6a36105 100644
--- a/tests/chunks/pipeline-interests-cubic.t.cpp
+++ b/tests/chunks/pipeline-interests-cubic.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2016-2022, Regents of the University of California,
+ * Copyright (c) 2016-2024, Regents of the University of California,
  *                          Colorado State University,
  *                          University Pierre & Marie Curie, Sorbonne University.
  *
@@ -45,16 +45,16 @@
   void
   createPipeline()
   {
-    auto pline = make_unique<PipelineInterestsCubic>(face, rttEstimator, opt);
+    auto pline = std::make_unique<PipelineInterestsCubic>(face, rttEstimator, opt);
     pipeline = pline.get();
     setPipeline(std::move(pline));
   }
 
 private:
-  static shared_ptr<RttEstimatorWithStats::Options>
+  static std::shared_ptr<RttEstimatorWithStats::Options>
   makeRttEstimatorOptions()
   {
-    auto rttOptions = make_shared<RttEstimatorWithStats::Options>();
+    auto rttOptions = std::make_shared<RttEstimatorWithStats::Options>();
     rttOptions->alpha = 0.125;
     rttOptions->beta = 0.25;
     rttOptions->k = 8;
diff --git a/tests/chunks/pipeline-interests-fixed.t.cpp b/tests/chunks/pipeline-interests-fixed.t.cpp
index b4f9723..24f14e9 100644
--- a/tests/chunks/pipeline-interests-fixed.t.cpp
+++ b/tests/chunks/pipeline-interests-fixed.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2016-2022, Regents of the University of California,
+ * Copyright (c) 2016-2024, Regents of the University of California,
  *                          Colorado State University,
  *                          University Pierre & Marie Curie, Sorbonne University.
  *
@@ -29,6 +29,8 @@
 
 #include "pipeline-interests-fixture.hpp"
 
+#include <cmath>
+
 namespace ndn::chunks::tests {
 
 class PipelineInterestFixedFixture : public PipelineInterestsFixture
@@ -46,7 +48,7 @@
   void
   createPipeline()
   {
-    auto pline = make_unique<PipelineInterestsFixed>(face, opt);
+    auto pline = std::make_unique<PipelineInterestsFixed>(face, opt);
     pipeline = pline.get();
     setPipeline(std::move(pline));
   }
@@ -187,7 +189,7 @@
   BOOST_REQUIRE_EQUAL(face.sentInterests.size(), opt.maxPipelineSize * 3 - 2);
 
   // nack for the first pipeline element (segment #0)
-  auto nack = make_shared<lp::Nack>(face.sentInterests[opt.maxPipelineSize]);
+  auto nack = std::make_shared<lp::Nack>(face.sentInterests[opt.maxPipelineSize]);
   nack->setReason(lp::NackReason::DUPLICATE);
   face.receive(*nack);
 
@@ -232,7 +234,7 @@
   advanceClocks(opt.interestLifetime);
 
   // nack for the first pipeline element (segment #0)
-  auto nack = make_shared<lp::Nack>(face.sentInterests[opt.maxPipelineSize]);
+  auto nack = std::make_shared<lp::Nack>(face.sentInterests[opt.maxPipelineSize]);
   nack->setReason(lp::NackReason::DUPLICATE);
   face.receive(*nack);
   BOOST_CHECK_EQUAL(hasFailed, false);
@@ -261,7 +263,7 @@
 
   // send nack for all the pipeline elements first interest
   for (size_t i = 0; i < opt.maxPipelineSize; i++) {
-    auto nack = make_shared<lp::Nack>(face.sentInterests[i]);
+    auto nack = std::make_shared<lp::Nack>(face.sentInterests[i]);
     nack->setReason(lp::NackReason::CONGESTION);
     face.receive(*nack);
     advanceClocks(time::nanoseconds(1));
@@ -283,7 +285,7 @@
     }
 
     for (size_t j = 0; j < opt.maxPipelineSize; j++) {
-      auto nack = make_shared<lp::Nack>(face.sentInterests[(opt.maxPipelineSize * i) + j]);
+      auto nack = std::make_shared<lp::Nack>(face.sentInterests[(opt.maxPipelineSize * i) + j]);
       nack->setReason(lp::NackReason::CONGESTION);
       face.receive(*nack);
       advanceClocks(time::nanoseconds(1));
diff --git a/tests/chunks/pipeline-interests-fixture.hpp b/tests/chunks/pipeline-interests-fixture.hpp
index 215f544..4e42223 100644
--- a/tests/chunks/pipeline-interests-fixture.hpp
+++ b/tests/chunks/pipeline-interests-fixture.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2016-2023, Regents of the University of California,
+ * Copyright (c) 2016-2024, Regents of the University of California,
  *                          Colorado State University,
  *                          University Pierre & Marie Curie, Sorbonne University.
  *
@@ -44,21 +44,21 @@
 {
 protected:
   void
-  setPipeline(unique_ptr<PipelineInterests> pline)
+  setPipeline(std::unique_ptr<PipelineInterests> pline)
   {
     m_pipeline = std::move(pline);
   }
 
-  shared_ptr<Data>
+  std::shared_ptr<Data>
   makeDataWithSegment(uint64_t segmentNo, bool setFinalBlockId = true) const
   {
-    auto data = make_shared<Data>(Name(name).appendVersion(0).appendSegment(segmentNo));
+    auto data = std::make_shared<Data>(Name(name).appendVersion(0).appendSegment(segmentNo));
     if (setFinalBlockId)
       data->setFinalBlock(name::Component::fromSegment(nDataSegments - 1));
     return signData(data);
   }
 
-  shared_ptr<Data>
+  std::shared_ptr<Data>
   makeDataWithSegmentAndCongMark(uint64_t segmentNo,
                                  uint64_t congestionMark = 1,
                                  bool setFinalBlockId = true) const
@@ -83,7 +83,7 @@
   bool hasFailed = false;
 
 private:
-  unique_ptr<PipelineInterests> m_pipeline;
+  std::unique_ptr<PipelineInterests> m_pipeline;
 };
 
 } // namespace ndn::chunks::tests
