#include <shared_mutex>
#include <boost/circular_buffer.hpp>
-#define SSTR(o) ({ \
- std::stringstream ss; \
- ss << o; \
- ss.str(); \
-})
+#define SSTR(o) ((std::ostringstream{} << o).str())
#define RGW_SNS_FLAG_ACTIVE 1
#define RGW_SNS_FLAG_ERROR 2
SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw")
target_link_libraries(unittest_rgw_url ${rgw_libs})
+# unittest_rgw_sync_trace
+add_executable(unittest_rgw_sync_trace test_rgw_sync_trace.cc)
+add_ceph_unittest(unittest_rgw_sync_trace)
+target_include_directories(unittest_rgw_sync_trace
+ SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw")
+target_link_libraries(unittest_rgw_sync_trace)
+
if(WITH_RADOSGW_RADOS)
add_executable(ceph_test_rgw_gc_log test_rgw_gc_log.cc $<TARGET_OBJECTS:unit-main>)
target_include_directories(ceph_test_rgw_gc_log
--- /dev/null
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*-
+// vim: ts=8 sw=2 sts=2 expandtab ft=cpp
+
+#include <gtest/gtest.h>
+#include "rgw/driver/rados/rgw_sync_trace.h"
+
+TEST(TestSSTR, using_a_var_named_ss)
+{
+ std::stringstream ss;
+
+ ss << "aaa";
+ auto result = SSTR("this is ss=" << ss.str());
+ ASSERT_EQ(result, "this is ss=aaa");
+}
+
+TEST(TestSSTR, using_a_var_named_other_than_ss)
+{
+ std::stringstream ss2;
+
+ ss2 << "aaa";
+ auto result = SSTR("this is ss2=" << ss2.str());
+ ASSERT_EQ(result, "this is ss2=aaa");
+}