]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librados/aio_cxx: use fmt formatting 49029/head
authorMatan Breizman <mbreizma@redhat.com>
Wed, 23 Nov 2022 17:18:10 +0000 (17:18 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Wed, 23 Nov 2022 17:25:58 +0000 (17:25 +0000)
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/test/librados/aio_cxx.cc

index b98d369a1d35057e897da2e855ab8217b5ab25d0..fb657ff18ec96c1bb84ddfd5c5eb442acb909f69 100644 (file)
@@ -14,6 +14,7 @@
 #include "include/stringify.h"
 #include "include/scope_guard.h"
 #include "common/ceph_mutex.h"
+#include <fmt/format.h>
 
 #include "test_cxx.h"
 #include "crimson_utils.h"
@@ -2295,9 +2296,14 @@ TEST(LibRadosAio, SimplePoolEIOFlag) {
     ASSERT_TRUE(my_completion);
 
     bufferlist empty;
-         ASSERT_EQ(0, test_data.m_cluster.mon_command(
-           "{\"prefix\": \"osd pool set\", \"pool\": \"" + test_data.m_pool_name +
-           "\", \"var\": \"eio\", \"val\": \"true\"}", empty, nullptr, nullptr));
+    ASSERT_EQ(0, test_data.m_cluster.mon_command(
+      fmt::format(R"({{
+                  "prefix": "osd pool set",
+                  "pool": "{}",
+                  "var": "eio",
+                  "val": "true"
+                  }})", test_data.m_pool_name),
+      empty, nullptr, nullptr));
 
     bufferlist bl;
     bl.append("some data");
@@ -2338,8 +2344,13 @@ TEST(LibRadosAio, PoolEIOFlag) {
        [&] {
          bufferlist empty;
          ASSERT_EQ(0, test_data.m_cluster.mon_command(
-           "{\"prefix\": \"osd pool set\", \"pool\": \"" + test_data.m_pool_name +
-           "\", \"var\": \"eio\", \"val\": \"true\"}", empty, nullptr, nullptr));
+           fmt::format(R"({{
+                       "prefix": "osd pool set",
+                       "pool": "{}",
+                       "var": "eio",
+                       "val": "true"
+                       }})", test_data.m_pool_name),
+           empty, nullptr, nullptr));
        });
     }