tests: use decorators to disable test data generators by default

Change-Id: I7f58bc4f939a6040f0dab647f07b9c29a4a16b4e
diff --git a/tests/unit/access-manager.t.cpp b/tests/unit/access-manager.t.cpp
index f98561a..13902e8 100644
--- a/tests/unit/access-manager.t.cpp
+++ b/tests/unit/access-manager.t.cpp
@@ -80,11 +80,9 @@
       .append("ENCRYPTED-BY")
       .append(user.getDefaultKey().getName());
 
-    face.receive(Interest(kdk)
-                 .setCanBePrefix(true).setMustBeFresh(true));
+    face.receive(Interest(kdk).setCanBePrefix(true).setMustBeFresh(true));
     advanceClocks(1_ms, 10);
 
-    BOOST_TEST_MESSAGE(kdk);
     BOOST_CHECK_EQUAL(face.sentData.at(0).getName(), kdk);
     face.sentData.clear();
   }
@@ -108,12 +106,10 @@
   BOOST_CHECK_EQUAL(nKdk, 2);
 }
 
-BOOST_AUTO_TEST_CASE(DumpPackets) // use this to update content of other test cases
+BOOST_AUTO_TEST_CASE(GenerateTestData,
+  * ut::description("regenerates the static test data used by other test cases")
+  * ut::disabled())
 {
-  if (std::getenv("NAC_DUMP_PACKETS") == nullptr) {
-    return;
-  }
-
   std::cerr << "const Block nacIdentity = \"";
   auto block = m_keyChain.exportSafeBag(nacIdentity.getDefaultKey().getDefaultCertificate(),
                                         "password", strlen("password"))->wireEncode();
diff --git a/tests/unit/decryptor.t.cpp b/tests/unit/decryptor.t.cpp
index 940a990..e7c2a0f 100644
--- a/tests/unit/decryptor.t.cpp
+++ b/tests/unit/decryptor.t.cpp
@@ -116,10 +116,10 @@
                     [&] (ConstBufferPtr buffer) {
                       ++nSuccesses;
                       BOOST_CHECK_EQUAL(buffer->size(), 15);
-                      std::string content(reinterpret_cast<const char*>(buffer->data()), buffer->size());
+                      std::string content(buffer->get<char>(), buffer->size());
                       BOOST_CHECK_EQUAL(content, "Data to encrypt");
                     },
-                    [&] (const ErrorCode& code, const std::string& msg) {
+                    [&] (const ErrorCode&, const std::string& msg) {
                       BOOST_TEST_MESSAGE(msg);
                       ++nFailures;
                     });
diff --git a/tests/unit/encryptor.t.cpp b/tests/unit/encryptor.t.cpp
index 147c663..dcbf579 100644
--- a/tests/unit/encryptor.t.cpp
+++ b/tests/unit/encryptor.t.cpp
@@ -195,12 +195,10 @@
   BOOST_CHECK_EQUAL(nCk, 3);
 }
 
-BOOST_AUTO_TEST_CASE(DumpPackets) // use this to update content of other test cases
+BOOST_AUTO_TEST_CASE(GenerateTestData,
+  * ut::description("regenerates the static test data used by other test cases")
+  * ut::disabled())
 {
-  if (std::getenv("NAC_DUMP_PACKETS") == nullptr) {
-    return;
-  }
-
   const auto plaintext = "Data to encrypt"s;
 
   std::cerr << "const std::vector<Block> encryptedBlobs = {\n";
diff --git a/tests/unit/static-data.hpp b/tests/unit/static-data.hpp
index 542d988..0df6540 100644
--- a/tests/unit/static-data.hpp
+++ b/tests/unit/static-data.hpp
@@ -22,15 +22,13 @@
 
 #include "common.hpp"
 
-#include <vector>
-
 namespace ndn {
 namespace nac {
 namespace tests {
 
 struct StaticData
 {
-  // generated by `NAC_DUMP_PACKETS=1 ./build/unit-tests`
+  // Regenerate with `./build/unit-tests -t '*/GenerateTestData'`
 
   const Block nacIdentity = "80FD080706FD02ED074808066163636573730806706F6C69637908086964656E7469747908034E414308076461746173657408034B455908086C20E1528A7E1FAD080473656C660809FD000001499D598CA0140918010219040036EE8015FD012630820122300D06092A864886F70D01010105000382010F003082010A0282010100D22558D6CE37846FC70DE4E4C19C7245166ADD41063CCDBA53F7E45F90C700DB0C84283B497902E77040817EAD45E46906F1FB94213A5D14A34F7BCFB2C6ACFCB59711042C52E41BCD9F344CAF281834599B412BBB8E5294CC118238A94E042D1F95167E8F2060F3047F834EEA32277E9B7557B874B9D864E7226EC77F3706B620506210FC9AA232C8479130D8453A4226CB4195E28939B2288455E27CA6BADA237009B02E02A55F28FD314957B89523F62B638EA9539225AF1D8719BC25703F584A189D698398E490CFC7C40FA96C5B5F5F8C0A9C4C66E17708DDEB414A3935CE6665D9AEE3AA6FDC2EE26F51F098B1DBE484F9C1D3D1996A93DA5D59397C0B020301000116681B01011C39073708066163636573730806706F6C69637908086964656E7469747908034E414308076461746173657408034B455908086C20E1528A7E1FADFD00FD26FD00FE0F313937303031303154303030303030FD00FF0F32303334313130365430353335333217FD01000216CC5A0FA69D494E6863A9713296788AE1B1ACFD37989A4395DAE45771B6553E2D788A7EB9882D634352882A2A0B7A5BA2C1A1694CA147C32F438178811F49E73F83837D1369CF3F9A2F8438E00C4EBA3AB727C02B3B1D03C67D95A4C1378D412554814F33E829F6784E8B0D02C5A18B059F274C718FBE3A6538CCCD060E6E943FDBC1FD925F4F6F6311352A425C172BD7B0F2A2D9F820D7BEBAAA0436374BE36F23811FBE0CC904C69AA952ED987CBF74D8AA0CA6AAD15E66E627F083C7B48574F6C5F05411DE85692C76D0A55086F339AA7BE188DA4CDB9DD32CE01E59EC45A9BB0509DA909C85898906386C361CA414569AD3DB8545D3B52C94C5CA6C9481FD05123082050E304006092A864886F70D01050D3033301B06092A864886F70D01050C300E04088FCAD0F240626DEB02020800301406082A864886F70D0307040802428859D6139700048204C82ACD21359F30F7E50D352BAD2A3B594633E869D1A36FD392A8F23A44DCF6EC8FC40688764D51255B2731AF3F8F151100C33D86516136E138717EC1696A671A814B1F5CD5670729647E39FACFE525CEF0F258F8B8235AD1B50484F3A0E40C2339486BAE871FBC212C274E4F0CC33DCDC1FBE2B9CBFAA8C5AA43D3DC6FD511E5AFEBF72510F19C5B71AAE4A85C3AFD0C09A85B38A3A9E82FE93F46D297BDA8DECDF23E935F93830312B856CB8548F8AB5CF3BE012E2A0477DF9C34392B32C7CD56B87E4A15C1C4FE5852DCBA2299A3225B86DD405EA7FCD523CB787468492CD0D22E2C854FEBAC8622546913FAE7DE25757512DC1CA3028C323700021F9B3A124928E1C04D2126D64BC125DF3C3B2B55952CE656D3B8DF0B1A5ECE94C8A6ADDEBE0C30D66A33CF8F959F15AB3217011B288B257FE0BF08A747D0B08507A7CE61E14721E85F73F9DD11C1B6AE3EE36B2C43A6C737CA267135E816BAC2C7AAE4DCBF119BC8A47DD2C17DB371D9366C26E11C95C3305CFF4E9D4386BA0D14789CE5DEF2C098D76F3B49B36BA43F93136F9AA3D9B7F08DBF270D3518C525BA78ADDD6B14DB0F56C7ABAC964CED5775C55A1A33A4B1856244823918301CF369718969C906AD91639EF1C5B49C2CB58F8C8C1B7FBD3552997C69FB32D19584A63710CD6D2B97EE7FD27CDE0EB74DE7DEF9C1DF022D947479ECA646406A14530CD145EDD6A1C13B1B9F12470FE90EFD8A12808357098310FB7E58E861AB97956ED825A9CCDCC5D92EB4D76C2035679306E3349B08ABC0AD809A611EB8CF6F0D888C2D24343DBB7180F2F2894E0BD92C9F575AAD470A98885595CD9C1F18FAB4411C1C5869746A10730699E669601F7D75A2B4542AE3F01055D7AB9EB7A7B8DBF1914A71FCF52A8524ACB9096A9DE896E73A8642AABBDAD3733F2D79EE60645397077944A8E78EA510D1F2C0E619725310B1D9258B56CEB61308C9A2033F872D2FD2F8C6BCDE76FCCCD51AC68E6163E68E4BFEC09CB5D47C85A914695086D52268B8B53DEF05550A2FB67BFEAD1FC04771A68FEAD6320F0944A6CB1B23126B35F9CC316D27E4EE7F8499E7898B7507B76FDD9DAF41EE753B21946EEEB5A3E82BAE96474937413E000992A1D533FA080238731667DF0811706CF958A38D1788EDA9E2D5E43CA8BE74BCE7D08ED4A4531BAA049B720AC31D7D224378A91AFAF3A8288A8B582771B3329A3DD50C8A29C9DE256B80F98FB3D2D780C5F475BA5804F18343B6E060D282B131D8B00AACA7BD8473028EB9E0287CCE265540115B446EDC3B86448C8B58920FC54ADF5D5A878B297FB1F2EB9EF02C08881F3D7D52AE1D037567B1EC629D926407488887D57EE8385D669E7784936CE03EA1CDCFE9016760B3F11515ECD10206ADC71160A8ADCACD29CCA0B1E1AA966C36BEB57F8501E60C7FC3C2C0EABD9012B086CC6A509FEF4506B16075A2A02BCECE88FD1FA9D8EE219655E625222F3C712725D087713BADC85074589F6A72ADAAB8E3B06095D77DF9F12D02F580B2695ED8833351C35A96AFFC1721DC5597E82A3B63FA112E7A85ADD2F3E2B758196F682ABC036A56F95AFF01DC254E4B3955BBC03C26866E871AEDFDDBC310E1F136D2D859EE826B8D90458FC26EEACAA775A3D28B34659DE676BB856C732B214290582D0143DC420B7D47A3938F2CD3E28D3F140A7DA8DB60EDDCF603295A73B40DD35D30924E47"_block;
   const std::vector<Block> userIdentities = {