diff --git a/src/rgw/rgw_dencoder.cc b/src/rgw/rgw_dencoder.cc index 10e9961e69e..82e32958fbe 100644 --- a/src/rgw/rgw_dencoder.cc +++ b/src/rgw/rgw_dencoder.cc @@ -419,6 +419,34 @@ void RGWBucketInfo::generate_test_instances(list& o) o.push_back(new RGWBucketInfo); } +void RGWRegion::generate_test_instances(list& o) +{ + RGWRegion *r = new RGWRegion; + o.push_back(r); + o.push_back(new RGWRegion); +} + +void RGWZone::generate_test_instances(list &o) +{ + RGWZone *z = new RGWZone; + o.push_back(z); + o.push_back(new RGWZone); +} + +void RGWZoneParams::generate_test_instances(list &o) +{ + o.push_back(new RGWZoneParams); + o.push_back(new RGWZoneParams); +} + +void RGWOLHInfo::generate_test_instances(list &o) +{ + RGWOLHInfo *olh = new RGWOLHInfo; + olh->removed = false; + o.push_back(olh); + o.push_back(new RGWOLHInfo); +} + void RGWBucketEnt::generate_test_instances(list& o) { RGWBucketEnt *e = new RGWBucketEnt; diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index b5c359fa941..13478bf7771 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -520,7 +520,6 @@ int RGWRegionMap::update(RGWRegion& region) return 0; } - void RGWObjVersionTracker::prepare_op_for_read(ObjectReadOperation *op) { obj_version *check_objv = version_for_check(); diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 097f08a6ea0..7716fffe035 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -76,7 +76,7 @@ struct RGWOLHInfo { ::decode(removed, bl); DECODE_FINISH(bl); } - + static void generate_test_instances(list& o); void dump(Formatter *f) const; }; WRITE_CLASS_ENCODER(RGWOLHInfo) @@ -788,6 +788,7 @@ struct RGWZoneParams { } void dump(Formatter *f) const; void decode_json(JSONObj *obj); + static void generate_test_instances(list& o); }; WRITE_CLASS_ENCODER(RGWZoneParams) @@ -833,6 +834,7 @@ struct RGWZone { } void dump(Formatter *f) const; void decode_json(JSONObj *obj); + static void generate_test_instances(list& o); }; WRITE_CLASS_ENCODER(RGWZone) @@ -852,6 +854,7 @@ struct RGWDefaultRegionInfo { } void dump(Formatter *f) const; void decode_json(JSONObj *obj); + //todo: implement ceph-dencoder }; WRITE_CLASS_ENCODER(RGWDefaultRegionInfo) @@ -954,6 +957,7 @@ struct RGWRegion { void dump(Formatter *f) const; void decode_json(JSONObj *obj); + static void generate_test_instances(list& o); }; WRITE_CLASS_ENCODER(RGWRegion) diff --git a/src/test/encoding/types.h b/src/test/encoding/types.h index dccce4bdc58..d67c9de9eb2 100644 --- a/src/test/encoding/types.h +++ b/src/test/encoding/types.h @@ -235,7 +235,11 @@ TYPE(librbd::WatchNotify::ResponseMessage) #include "rgw/rgw_rados.h" TYPE(RGWObjManifestPart) TYPE(RGWObjManifest) - +TYPE(RGWOLHInfo) +TYPE(RGWRegion) +TYPE(RGWZone) +TYPE(RGWZoneParams) + #include "rgw/rgw_acl.h" TYPE(ACLPermission) TYPE(ACLGranteeType)