From: Kefu Chai Date: Fri, 8 Jan 2021 05:42:18 +0000 (+0800) Subject: test/test_rbd_replay: move operator<<(..rbd_loc& name) to rbd_replay X-Git-Tag: v15.2.17~64^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=bb906e475d68b74ba2d7d8277f1ee11689153fa1;p=ceph.git test/test_rbd_replay: move operator<<(..rbd_loc& name) to rbd_replay so gtest can print out rbd_loc when printing out diagnostic information when test fails. after moving operator<<(ostream&, const rbd_loc&) to the `rbd_replay` namespace, ADL is able to find it. for more details on the lookup rules, see https://en.cppreference.com/w/cpp/language/adl Signed-off-by: Kefu Chai (cherry picked from commit fe696638515dc7a51214930049ebd1a6f951047f) --- diff --git a/src/test/test_rbd_replay.cc b/src/test/test_rbd_replay.cc index 24146875a271a..c4a0b3a9ed6c6 100644 --- a/src/test/test_rbd_replay.cc +++ b/src/test/test_rbd_replay.cc @@ -22,11 +22,13 @@ #include "rbd_replay/rbd_loc.hpp" -using namespace rbd_replay; - +namespace rbd_replay { std::ostream& operator<<(std::ostream& o, const rbd_loc& name) { return o << "('" << name.pool << "', '" << name.image << "', '" << name.snap << "')"; } +} + +using namespace rbd_replay; static void add_mapping(ImageNameMap *map, std::string mapping_string) { ImageNameMap::Mapping mapping;