]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librbd: print uint64_t in a platform neutral way
authorKefu Chai <kchai@redhat.com>
Mon, 1 May 2017 04:27:44 +0000 (12:27 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 1 May 2017 07:45:42 +0000 (15:45 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/test/librbd/test_internal.cc
src/test/librbd/test_librbd.cc
src/test/librbd/test_support.cc

index 5b4f1d68162a5f6e69989a4161418aa151c11c07..92121beab99837ccf7fb3ca3fb97241e17739828 100644 (file)
@@ -1030,7 +1030,7 @@ TEST_F(TestInternal, TestCoR)
   ASSERT_EQ(0, image.stat(info, sizeof(info)));
 
   const int object_num = info.size / info.obj_size;
-  printf("made parent image \"%s\": %ldK (%d * %ldK)\n", m_image_name.c_str(),
+  printf("made parent image \"%s\": %ldK (%d * %" PRIu64 "K)\n", m_image_name.c_str(),
          (unsigned long)m_image_size, object_num, info.obj_size/1024);
 
   // write something into parent
@@ -1167,8 +1167,8 @@ TEST_F(TestInternal, FlattenNoEmptyObjects)
   ASSERT_EQ(0, image.stat(info, sizeof(info)));
 
   const int object_num = info.size / info.obj_size;
-  printf("made parent image \"%s\": %ldK (%d * %ldK)\n", m_image_name.c_str(),
-         (unsigned long)m_image_size, object_num, info.obj_size/1024);
+  printf("made parent image \"%s\": %" PRIu64 "K (%d * %" PRIu64 "K)\n",
+        m_image_name.c_str(), m_image_size, object_num, info.obj_size/1024);
 
   // write something into parent
   char test_data[TEST_IO_SIZE + 1];
index 3d2089480922f04f039ccb02e552a1950959771c..989b605e23b4858173bf5ce8d2c6a65aa2373177 100644 (file)
@@ -109,7 +109,8 @@ static int create_image_full(rados_ioctx_t ioctx, const char *name,
       stripe_unit = (1ull << (*order-1));
     }
 
-    printf("creating image with stripe unit: %ld, stripe count: %ld\n",
+    printf("creating image with stripe unit: %" PRIu64 ", "
+          "stripe count: %" PRIu64 "\n",
            stripe_unit, IMAGE_STRIPE_COUNT);
     return rbd_create3(ioctx, name, size, features, order,
                        stripe_unit, IMAGE_STRIPE_COUNT);
index db16131df05e9218cdfa2076d7a1f9ef9915e19c..fa8e25194a7661b2856f2d920bab83e406b06550 100644 (file)
@@ -40,7 +40,7 @@ int create_image_full_pp(librbd::RBD &rbd, librados::IoCtx &ioctx,
       stripe_unit = (1ull << (*order-1));
     }
 
-    printf("creating image with stripe unit: %ld, stripe count: %ld\n",
+    printf("creating image with stripe unit: %" PRIu64 ", stripe count: %" PRIu64 "\n",
            stripe_unit, IMAGE_STRIPE_COUNT);
     return rbd.create3(ioctx, name.c_str(), size, features, order, stripe_unit,
                        IMAGE_STRIPE_COUNT);