X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Ftest%2Fencoding%2Ftest_sstring.h;fp=src%2Fceph%2Fsrc%2Ftest%2Fencoding%2Ftest_sstring.h;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=c2493c10efae69fa6bd4fa65839fee9323b4157f;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/test/encoding/test_sstring.h b/src/ceph/src/test/encoding/test_sstring.h deleted file mode 100644 index c2493c1..0000000 --- a/src/ceph/src/test/encoding/test_sstring.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef TEST_SSTRING_H -#define TEST_SSTRING_H - -#include "common/sstring.hh" - -// wrapper for sstring that implements the dencoder interface -class sstring_wrapper { - using sstring16 = basic_sstring; - sstring16 s1; - using sstring24 = basic_sstring; - sstring24 s2; - public: - sstring_wrapper() = default; - sstring_wrapper(sstring16&& s1, sstring24&& s2) - : s1(std::move(s1)), s2(std::move(s2)) - {} - - DENC(sstring_wrapper, w, p) { - DENC_START(1, 1, p); - denc(w.s1, p); - denc(w.s2, p); - DENC_FINISH(p); - } - void dump(Formatter* f) { - f->dump_string("s1", s1.c_str()); - f->dump_string("s2", reinterpret_cast(s2.c_str())); - } - static void generate_test_instances(std::list& ls) { - ls.push_back(new sstring_wrapper()); - // initialize sstrings that fit in internal storage - constexpr auto cstr6 = "abcdef"; - ls.push_back(new sstring_wrapper(sstring16{cstr6}, sstring24{cstr6})); - // initialize sstrings that overflow into external storage - constexpr auto cstr26 = "abcdefghijklmnopqrstuvwxyz"; - ls.push_back(new sstring_wrapper(sstring16{cstr26}, sstring24{cstr26})); - } -}; -WRITE_CLASS_DENC(sstring_wrapper) - -#endif