Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / cls / refcount / cls_refcount_ops.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #include "cls_refcount_ops.h"
5 #include "common/Formatter.h"
6 #include "common/ceph_json.h"
7
8 void cls_refcount_get_op::dump(ceph::Formatter *f) const
9 {
10   f->dump_string("tag", tag);
11   f->dump_int("implicit_ref", (int)implicit_ref);
12 }
13
14 void cls_refcount_get_op::generate_test_instances(list<cls_refcount_get_op*>& ls)
15 {
16   ls.push_back(new cls_refcount_get_op);
17   ls.push_back(new cls_refcount_get_op);
18   ls.back()->tag = "foo";
19   ls.back()->implicit_ref = true;
20 }
21
22
23 void cls_refcount_put_op::dump(ceph::Formatter *f) const
24 {
25   f->dump_string("tag", tag);
26   f->dump_int("implicit_ref", (int)implicit_ref);
27 }
28
29 void cls_refcount_put_op::generate_test_instances(list<cls_refcount_put_op*>& ls)
30 {
31   ls.push_back(new cls_refcount_put_op);
32   ls.push_back(new cls_refcount_put_op);
33   ls.back()->tag = "foo";
34   ls.back()->implicit_ref = true;
35 }
36
37
38
39 void cls_refcount_set_op::dump(ceph::Formatter *f) const
40 {
41   encode_json("refs", refs, f);
42 }
43
44 void cls_refcount_set_op::generate_test_instances(list<cls_refcount_set_op*>& ls)
45 {
46   ls.push_back(new cls_refcount_set_op);
47   ls.push_back(new cls_refcount_set_op);
48   ls.back()->refs.push_back("foo");
49   ls.back()->refs.push_back("bar");
50 }
51
52
53 void cls_refcount_read_op::dump(ceph::Formatter *f) const
54 {
55   f->dump_int("implicit_ref", (int)implicit_ref);
56 }
57
58 void cls_refcount_read_op::generate_test_instances(list<cls_refcount_read_op*>& ls)
59 {
60   ls.push_back(new cls_refcount_read_op);
61   ls.push_back(new cls_refcount_read_op);
62   ls.back()->implicit_ref = true;
63 }
64
65
66 void cls_refcount_read_ret::dump(ceph::Formatter *f) const
67 {
68   f->open_array_section("refs");
69   for (list<string>::const_iterator p = refs.begin(); p != refs.end(); ++p)
70     f->dump_string("ref", *p);
71   f->close_section();
72 }
73
74 void cls_refcount_read_ret::generate_test_instances(list<cls_refcount_read_ret*>& ls)
75 {
76   ls.push_back(new cls_refcount_read_ret);
77   ls.push_back(new cls_refcount_read_ret);
78   ls.back()->refs.push_back("foo");
79   ls.back()->refs.push_back("bar");
80 }