Format all C++ and Java code via clang-format

Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
Konstantin Pastbin
2025-08-17 14:32:37 +07:00
parent 9f0290c0ec
commit bfffa1fff4
2169 changed files with 56441 additions and 64188 deletions

View File

@@ -18,9 +18,21 @@ class TestUrl
public:
explicit TestUrl(string && url) : m_url(std::move(url)) {}
TestUrl & Scheme(string && scheme) { m_scheme = std::move(scheme); return *this; }
TestUrl & Host(string && host) { m_host = std::move(host); return *this; }
TestUrl & Path(string && path) { m_path = std::move(path); return *this; }
TestUrl & Scheme(string && scheme)
{
m_scheme = std::move(scheme);
return *this;
}
TestUrl & Host(string && host)
{
m_host = std::move(host);
return *this;
}
TestUrl & Path(string && path)
{
m_path = std::move(path);
return *this;
}
TestUrl & KV(string && key, string && value)
{
m_keyValuePairs.emplace(std::move(key), std::move(value));
@@ -115,17 +127,9 @@ UNIT_TEST(Url_Valid)
.KV("ll", "10.3,12.3223")
.KV("n", "Hello World");
TestUrl("cm:M&M//path?q=q&w=w")
.Scheme("cm")
.Host("M&M")
.Path("path")
.KV("q", "q")
.KV("w", "w");
TestUrl("cm:M&M//path?q=q&w=w").Scheme("cm").Host("M&M").Path("path").KV("q", "q").KV("w", "w");
TestUrl("http://www.sandwichparlour.com.au/")
.Scheme("http")
.Host("www.sandwichparlour.com.au")
.Path("");
TestUrl("http://www.sandwichparlour.com.au/").Scheme("http").Host("www.sandwichparlour.com.au").Path("");
TestUrl("cm:/&test").Scheme("cm").Host("&test").Path("");
}
@@ -160,21 +164,40 @@ UNIT_TEST(UrlScheme_Comprehensive)
TestUrl("http://host/path/to/something").Scheme("http").Host("host").Path("path/to/something");
TestUrl("http://host?").Scheme("http").Host("host").Path("");
TestUrl("maps://host?&&key=&").Scheme("maps").Host("host").KV("key", "");
TestUrl("mapswithme://map?ll=1.2,3.4&z=15").Scheme("mapswithme").Host("map").Path("")
.KV("ll", "1.2,3.4").KV("z", "15");
TestUrl("nopathnovalues://?key1&key2=val2").Scheme("nopathnovalues").Host("").Path("")
.KV("key1", "").KV("key2", "val2");
TestUrl("mapswithme://map?ll=1.2,3.4&z=15")
.Scheme("mapswithme")
.Host("map")
.Path("")
.KV("ll", "1.2,3.4")
.KV("z", "15");
TestUrl("nopathnovalues://?key1&key2=val2")
.Scheme("nopathnovalues")
.Host("")
.Path("")
.KV("key1", "")
.KV("key2", "val2");
TestUrl("s://?key1&key2").Scheme("s").Host("").Path("").KV("key1", "").KV("key2", "");
TestUrl("g://h/p?key1=val1&key2=").Scheme("g").Host("h").Path("p").KV("key1", "val1").KV("key2", "");
TestUrl("g://h?=val1&key2=").Scheme("g").Host("h").Path("").KV("", "val1").KV("key2", "");
TestUrl("g://?k&key2").Scheme("g").Host("").Path("").KV("k", "").KV("key2", "");
TestUrl("m:?%26Amp%26%3D%26Amp%26&name=%31%20%30").Scheme("m").Host("").Path("")
.KV("&Amp&=&Amp&", "").KV("name", "1 0");
TestUrl("m:?%26Amp%26%3D%26Amp%26&name=%31%20%30")
.Scheme("m")
.Host("")
.Path("")
.KV("&Amp&=&Amp&", "")
.KV("name", "1 0");
TestUrl("s://?key1=value1&key1=value2&key1=value3&key2&key2&key3=value1&key3&key3=value2")
.Scheme("s").Host("").Path("")
.KV("key1", "value1").KV("key1", "value2").KV("key1", "value3")
.KV("key2", "").KV("key2", "")
.KV("key3", "value1").KV("key3", "").KV("key3", "value2");
.Scheme("s")
.Host("")
.Path("")
.KV("key1", "value1")
.KV("key1", "value2")
.KV("key1", "value3")
.KV("key2", "")
.KV("key2", "")
.KV("key3", "value1")
.KV("key3", "")
.KV("key3", "value2");
}
UNIT_TEST(UrlApi_Smoke)