]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
tests/librados: do not use '0' as a string
authorRonen Friedman <rfriedma@redhat.com>
Tue, 7 May 2024 13:20:18 +0000 (16:20 +0300)
committerRonen Friedman <rfriedma@redhat.com>
Tue, 7 May 2024 13:20:18 +0000 (16:20 +0300)
not even as a default string parameter to a
function.

C++23 does not allow int-to-string conversions,

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/test/librados/tier_cxx.cc

index be1d411a910d8001fe72e255408291320d644169..ecef8bd36422bb5aa98e9a4a4496597c0298c0db 100644 (file)
@@ -120,7 +120,7 @@ static inline void buf_to_hex(const unsigned char *buf, int len, char *str)
 }
 
 void check_fp_oid_refcount(librados::IoCtx& ioctx, std::string foid, uint64_t count,
-                          std::string fp_algo = NULL)
+                          std::string fp_algo = std::string{})
 {
   bufferlist t;
   int size = foid.length();
@@ -148,7 +148,7 @@ void check_fp_oid_refcount(librados::IoCtx& ioctx, std::string foid, uint64_t co
   ASSERT_LE(count, refs.count());
 }
 
-string get_fp_oid(string oid, std::string fp_algo = NULL)
+string get_fp_oid(string oid, std::string fp_algo = std::string{})
 {
   if (fp_algo == "sha1") {
     unsigned char fingerprint[CEPH_CRYPTO_SHA1_DIGESTSIZE + 1];