]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
hobject_t: make max private
authorSamuel Just <sam.just@inktank.com>
Thu, 29 Nov 2012 21:51:41 +0000 (13:51 -0800)
committerSamuel Just <sam.just@inktank.com>
Thu, 29 Nov 2012 21:51:51 +0000 (13:51 -0800)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/os/hobject.h
src/test/filestore/store_test.cc

index 9a1c207e796396f261d3dcb8946545a617971113..00097f471573590a9f84f0594fbe4b60a02e4846 100644 (file)
@@ -31,7 +31,9 @@ struct hobject_t {
   object_t oid;
   snapid_t snap;
   uint32_t hash;
+private:
   bool max;
+public:
   int64_t pool;
   string nspace;
 
@@ -108,6 +110,12 @@ public:
   void decode(json_spirit::Value& v);
   void dump(Formatter *f) const;
   static void generate_test_instances(list<hobject_t*>& o);
+  friend bool operator<(const hobject_t&, const hobject_t&);
+  friend bool operator>(const hobject_t&, const hobject_t&);
+  friend bool operator<=(const hobject_t&, const hobject_t&);
+  friend bool operator>=(const hobject_t&, const hobject_t&);
+  friend bool operator==(const hobject_t&, const hobject_t&);
+  friend bool operator!=(const hobject_t&, const hobject_t&);
 };
 WRITE_CLASS_ENCODER(hobject_t)
 
index 55fde77f0fc04207a38e2d7f180e5645bbbe2aeb..3a41fa10e4c6bd78f3af7e68929dd6ca8e5e79ab 100644 (file)
@@ -212,7 +212,7 @@ TEST_F(StoreTest, ManyObjectTest) {
     ASSERT_EQ(r, 0);
     listed.insert(objects.begin(), objects.end());
     if (objects.size() < 50) {
-      ASSERT_TRUE(next.max);
+      ASSERT_TRUE(next.is_max());
       break;
     }
     objects.clear();
@@ -385,7 +385,7 @@ public:
       ASSERT_TRUE(sorted(objects));
       objects_set.insert(objects.begin(), objects.end());
       objects.clear();
-      if (next.max) break;
+      if (next.is_max()) break;
       current = next;
     }
     ASSERT_EQ(objects_set.size(), available_objects.size());
@@ -529,7 +529,7 @@ TEST_F(StoreTest, HashCollisionTest) {
       listed.insert(*i);
     }
     if (objects.size() < 50) {
-      ASSERT_TRUE(next.max);
+      ASSERT_TRUE(next.is_max());
       break;
     }
     objects.clear();