From f77f2a01fb49b52f02d6493e926d0ccc41abf4d0 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Tue, 26 Jan 2021 19:01:02 +0100 Subject: [HICN-677] Fix compilation error for tests in ubuntu bionic. Signed-off-by: Mauro Sardara Change-Id: I5ee18d4039a40bf47e889b90748bdbd94987a5ed --- libtransport/src/test/test_core_manifest.cc | 43 +---------------------------- 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/libtransport/src/test/test_core_manifest.cc b/libtransport/src/test/test_core_manifest.cc index c88ca347b..faf17dcf0 100644 --- a/libtransport/src/test/test_core_manifest.cc +++ b/libtransport/src/test/test_core_manifest.cc @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -197,48 +198,6 @@ TEST_F(ManifestTest, SetSuffixList) { delete[] entries; } -TEST_F(ManifestTest, EstimateSize) { - manifest1_.clear(); - - auto hash1 = utils::CryptoHashType::SHA_256; - NextSegmentCalculationStrategy strategy1 = - NextSegmentCalculationStrategy::INCREMENTAL; - ManifestType type1 = ManifestType::INLINE_MANIFEST; - core::Name base_name1("b001:abcd:fede:baba:cece:d0d0:face:dead"); - - manifest1_.setFinalManifest(true); - manifest1_.setBaseName(base_name1); - manifest1_.setNextSegmentCalculationStrategy(strategy1); - manifest1_.setHashAlgorithm(hash1); - manifest1_.setManifestType(type1); - - std::default_random_engine eng((std::random_device())()); - std::uniform_int_distribution idis( - 0, std::numeric_limits::max()); - - using random_bytes_engine = - std::independent_bits_engine; - random_bytes_engine rbe; - - while (manifest1_.estimateManifestSize(1) < 1440) { - uint32_t suffix = static_cast(idis(eng)); - std::vector data(32); - std::generate(std::begin(data), std::end(data), std::ref(rbe)); - auto hash = utils::CryptoHash(data.data(), data.size(), - utils::CryptoHashType::SHA_256); - manifest1_.addSuffixHash(suffix, hash); - } - - manifest1_.encode(); - manifest1_.decode(); - - manifest1_.dump(); - - ASSERT_GT(manifest1_.estimateManifestSize(), 0); - ASSERT_LT(manifest1_.estimateManifestSize(), 1500); -} - } // namespace core } // namespace transport -- cgit 1.2.3-korg