style: Mark JSON literal strings with R"JSON (#2169)

This commit is contained in:
Ayaz Salikhov
2025-05-30 15:50:39 +01:00
committed by GitHub
parent 7588e9d5bf
commit ecdea015b9
76 changed files with 2811 additions and 2748 deletions

View File

@@ -37,7 +37,7 @@ struct BackendCountersTest : WithPrometheus {
static boost::json::object
emptyReport()
{
return boost::json::parse(R"({
return boost::json::parse(R"JSON({
"too_busy": 0,
"write_sync": 0,
"write_sync_retry": 0,
@@ -49,7 +49,7 @@ struct BackendCountersTest : WithPrometheus {
"read_async_completed": 0,
"read_async_retry": 0,
"read_async_error": 0
})")
})JSON")
.as_object();
}

View File

@@ -81,7 +81,7 @@ class SettingsProviderTest : public NoLoggerFixture {};
TEST_F(SettingsProviderTest, Defaults)
{
auto const cfg = getParseSettingsConfig(json::parse(R"({"contact_points": "127.0.0.1"})"));
auto const cfg = getParseSettingsConfig(json::parse(R"JSON({"contact_points": "127.0.0.1"})JSON"));
SettingsProvider const provider{cfg.getObject("database.cassandra")};
auto const settings = provider.getSettings();
@@ -110,14 +110,14 @@ TEST_F(SettingsProviderTest, Defaults)
TEST_F(SettingsProviderTest, SimpleConfig)
{
auto const cfg = getParseSettingsConfig(json::parse(R"({
auto const cfg = getParseSettingsConfig(json::parse(R"JSON({
"database.cassandra.contact_points": "123.123.123.123",
"database.cassandra.port": 1234,
"database.cassandra.keyspace": "test",
"database.cassandra.replication_factor": 42,
"database.cassandra.table_prefix": "prefix",
"database.cassandra.threads": 24
})"));
})JSON"));
SettingsProvider const provider{cfg.getObject("database.cassandra")};
auto const settings = provider.getSettings();
@@ -135,10 +135,10 @@ TEST_F(SettingsProviderTest, SimpleConfig)
TEST_F(SettingsProviderTest, DriverOptionalOptionsSpecified)
{
auto const cfg = getParseSettingsConfig(json::parse(R"({
auto const cfg = getParseSettingsConfig(json::parse(R"JSON({
"database.cassandra.contact_points": "123.123.123.123",
"database.cassandra.queue_size_io": 2
})"));
})JSON"));
SettingsProvider const provider{cfg.getObject("database.cassandra")};
auto const settings = provider.getSettings();
@@ -148,7 +148,7 @@ TEST_F(SettingsProviderTest, DriverOptionalOptionsSpecified)
TEST_F(SettingsProviderTest, SecureBundleConfig)
{
auto const cfg =
getParseSettingsConfig(json::parse(R"({"database.cassandra.secure_connect_bundle": "bundleData"})"));
getParseSettingsConfig(json::parse(R"JSON({"database.cassandra.secure_connect_bundle": "bundleData"})JSON"));
SettingsProvider const provider{cfg.getObject("database.cassandra")};
auto const settings = provider.getSettings();
@@ -161,10 +161,10 @@ TEST_F(SettingsProviderTest, CertificateConfig)
{
TmpFile const file{"certificateData"};
auto const cfg = getParseSettingsConfig(json::parse(fmt::format(
R"({{
R"JSON({{
"database.cassandra.contact_points": "127.0.0.1",
"database.cassandra.certfile": "{}"
}})",
}})JSON",
file.path
)));
SettingsProvider const provider{cfg.getObject("database.cassandra")};