From: Kefu Chai Date: Wed, 13 Jan 2021 13:01:43 +0000 (+0800) Subject: tests/test_bluestore_types: cast duration to ceph::timespan X-Git-Tag: v16.1.0~56^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F38882%2Fhead;p=ceph.git 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 --- diff --git a/src/test/objectstore/test_bluestore_types.cc b/src/test/objectstore/test_bluestore_types.cc index 6ddf717d6056..a830915952af 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, "