diff options
author | Sage Weil <sage@inktank.com> | 2013-06-04 09:38:23 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-06-04 09:38:23 -0700 |
commit | 8bbd0370c4ffc254bc82fbcf57aee2a9824b409e (patch) | |
tree | 446cb2b26b6faa5019956f6857715f82e4a43275 | |
parent | 1cb7dbd94ab686987d1ef6e58a5f7a9406a3d477 (diff) | |
parent | 17029b270dee386e12e5f42c2494a5feffd49b08 (diff) | |
download | ceph-8bbd0370c4ffc254bc82fbcf57aee2a9824b409e.tar.gz |
Merge pull request #344 from ceph/wip-5220
Reviewed-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | src/test/librbd/test_librbd.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/librbd/test_librbd.cc b/src/test/librbd/test_librbd.cc index 030e840c5e5..562be6a6bcf 100644 --- a/src/test/librbd/test_librbd.cc +++ b/src/test/librbd/test_librbd.cc @@ -431,7 +431,7 @@ int test_ls_snaps(rbd_image_t image, int num_expected, ...) rbd_snap_info_t *snaps; int num_snaps, i, j, max_size = 10; va_list ap; - snaps = (rbd_snap_info_t *) malloc(sizeof(rbd_snap_info_t *) * 10); + snaps = (rbd_snap_info_t *) malloc(sizeof(rbd_snap_info_t *) * max_size); num_snaps = rbd_snap_list(image, snaps, &max_size); printf("num snaps is: %d\nexpected: %d\n", num_snaps, num_expected); @@ -442,14 +442,14 @@ int test_ls_snaps(rbd_image_t image, int num_expected, ...) va_start(ap, num_expected); for (i = num_expected; i > 0; i--) { char *expected = va_arg(ap, char *); - int expected_size = va_arg(ap, int); + uint64_t expected_size = va_arg(ap, uint64_t); int found = 0; for (j = 0; j < num_snaps; j++) { if (snaps[j].name == NULL) continue; if (strcmp(snaps[j].name, expected) == 0) { printf("found %s with size %llu\n", snaps[j].name, (unsigned long long) snaps[j].size); - assert((int)snaps[j].size == expected_size); + assert(snaps[j].size == expected_size); free((void *) snaps[j].name); snaps[j].name = NULL; found = 1; @@ -519,14 +519,14 @@ int test_ls_snaps(librbd::Image& image, size_t num_expected, ...) va_start(ap, num_expected); for (i = num_expected; i > 0; i--) { char *expected = va_arg(ap, char *); - size_t expected_size = va_arg(ap, int); + uint64_t expected_size = va_arg(ap, uint64_t); int found = 0; for (j = 0; j < snaps.size(); j++) { if (snaps[j].name == "") continue; if (strcmp(snaps[j].name.c_str(), expected) == 0) { cout << "found " << snaps[j].name << " with size " << snaps[j].size << endl; - assert(snaps[j].size == (size_t) expected_size); + assert(snaps[j].size == expected_size); snaps[j].name = ""; found = 1; break; |