tests: use decorators to label test data generators

Also various minor cleanups

Change-Id: Iaee434991b923abdf464293fec35da22d6cb449a
diff --git a/tests/unit/security/trust-anchor-container.t.cpp b/tests/unit/security/trust-anchor-container.t.cpp
index 0e76214..879ef40 100644
--- a/tests/unit/security/trust-anchor-container.t.cpp
+++ b/tests/unit/security/trust-anchor-container.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2023 Regents of the University of California.
+ * Copyright (c) 2013-2024 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -55,19 +55,20 @@
   }
 
   void
-  checkFindByInterest(const Name& name, bool canBePrefix, std::optional<Certificate> expected) const
+  checkFindByInterest(const Name& name, bool canBePrefix,
+                      const std::optional<Certificate>& expected) const
   {
     Interest interest(name);
     interest.setCanBePrefix(canBePrefix);
-    BOOST_TEST_CONTEXT(interest) {
-      auto found = anchorContainer.find(interest);
-      if (expected) {
-        BOOST_REQUIRE(found != nullptr);
-        BOOST_CHECK_EQUAL(found->getName(), expected->getName());
-      }
-      else {
-        BOOST_CHECK(found == nullptr);
-      }
+    BOOST_TEST_INFO_SCOPE("Interest = " << interest);
+
+    auto found = anchorContainer.find(interest);
+    if (expected) {
+      BOOST_REQUIRE(found != nullptr);
+      BOOST_CHECK_EQUAL(found->getName(), expected->getName());
+    }
+    else {
+      BOOST_CHECK(found == nullptr);
     }
   }