From bb4bb800fd56a0279224768990611d558ed38e7a Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 13 Jan 2021 21:01:43 +0800 Subject: [PATCH] tests/test_bluestore_types: cast duration to ceph::timespan on FreeBSD + Clang + libc++ + amd64, std::chrono::nanoseconds::rep is `long long` instead of `long`, so the explictly instantiated template operator<< operator instances in `src/common/ceph_time.cc` are not able to cover this use case. so in this change, the duration is casted to ceph::timespan instead of nanoseconds. so we can ensure that `operator<<` is always available in this case. Signed-off-by: Kefu Chai --- src/test/objectstore/test_bluestore_types.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/objectstore/test_bluestore_types.cc b/src/test/objectstore/test_bluestore_types.cc index 6ddf717d60568..a830915952aff 100644 --- a/src/test/objectstore/test_bluestore_types.cc +++ b/src/test/objectstore/test_bluestore_types.cc @@ -326,7 +326,7 @@ TEST(bluestore_blob_t, csum_bench) b.calc_csum(0, bl); } ceph::mono_clock::time_point end = ceph::mono_clock::now(); - auto dur = std::chrono::duration_cast(end - start); + auto dur = std::chrono::duration_cast(end - start); double mbsec = (double)count * (double)bl.length() / 1000000.0 / (double)dur.count() * 1000000000.0; cout << "csum_type " << Checksummer::get_csum_type_string(csum_type) << ", " << dur << " seconds, " -- 2.39.5