]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
testradospp: add a test for librados trunc
authorYehuda Sadeh <yehuda@hq.newdream.net>
Thu, 10 Jun 2010 21:42:11 +0000 (14:42 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Thu, 10 Jun 2010 21:42:11 +0000 (14:42 -0700)
src/testradospp.cc

index 4990f70d2aa2027a7929153b6a432f751e6c252d..0da7024979d7cdbf08e3c3ea2ae1bdcde7f59321 100644 (file)
@@ -70,6 +70,10 @@ int main(int argc, const char **argv)
   cout << "rados.write_full returned " << r << std::endl;
   r = rados.read(pool, oid, 0, bl, bl.length());
   cout << "rados.read returned " << r << std::endl;
+  r = rados.trunc(pool, oid, 8);
+  cout << "rados.trunc returned " << r << std::endl;
+  r = rados.read(pool, oid, 0, bl, bl.length());
+  cout << "rados.read returned " << r << std::endl;
   r = rados.exec(pool, oid, "crypto", "md5", bl, bl2);
   cout << "exec returned " << r <<  " buf size=" << bl2.length() << std::endl;
   const unsigned char *md5 = (const unsigned char *)bl2.c_str();