From: Samuel Just Date: Fri, 11 Mar 2016 22:05:37 +0000 (-0800) Subject: store_test: improve synthetic test coverage of long object names X-Git-Tag: v10.1.0~76^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4b44720f752ebac63454ecd338e2b0c77c8fe501;p=ceph.git store_test: improve synthetic test coverage of long object names 1/2 of objects will now have long names, and we'll shift the region of the hash space where new objects are created every 1024 objects created. Signed-off-by: Samuel Just --- diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index 5520d1632ae3..f438056a0598 100644 --- a/src/test/objectstore/store_test.cc +++ b/src/test/objectstore/store_test.cc @@ -1681,11 +1681,17 @@ public: char buf[100]; snprintf(buf, sizeof(buf), "OBJ_%u", seq); string name(buf); + if (seq % 2) { + for (unsigned i = 0; i < 300; ++i) { + name.push_back('a'); + } + } ++seq; return ghobject_t( hobject_t( name, string(), rand() & 2 ? CEPH_NOSNAP : rand(), - seq % 16, // use smaller set of hash values so clone can work + (((seq / 1024) % 2) * 0xF00 ) + + (seq & 0xFF), poolid, "")); } };