From 4b44720f752ebac63454ecd338e2b0c77c8fe501 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Fri, 11 Mar 2016 14:05:37 -0800 Subject: [PATCH] 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 --- src/test/objectstore/store_test.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index 5520d1632ae..f438056a059 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, "")); } }; -- 2.47.3