Apply pre-commit fixes

Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
This commit is contained in:
Cristian Le 2023-05-09 11:50:00 +02:00 committed by Cristian Le
parent 98536513f6
commit 4252d4ccfb
Failed to extract signature
16 changed files with 723 additions and 740 deletions

View File

@ -1,17 +1,14 @@
---
BasedOnStyle: LLVM
AccessModifierOffset: -2
BasedOnStyle: LLVM
#AlignConsecutiveAssignments: true
#AlignConsecutiveDeclarations: true
AllowShortFunctionsOnASingleLine: Inline
BreakBeforeBraces: Linux
ColumnLimit: 0
ColumnLimit: 0
ConstructorInitializerAllOnOneLineOrOnePerLine: true
IndentWidth: 4
IndentWidth: 4
IndentPPDirectives: AfterHash
ObjCBlockIndentWidth: 0
SpaceAfterCStyleCast: true
TabWidth: 4
TabWidth: 4
AccessModifierOffset: -4
UseTab: ForIndentation
...
UseTab: ForIndentation

File diff suppressed because it is too large Load Diff

View File

@ -29,6 +29,6 @@ SOFTWARE.
*/
bool is_address(const char* p, const char* pe);
bool is_address(const char *p, const char *pe);
#endif // SMTP_ADDRESS_PARSER_HPP_INCLUDED

View File

@ -182,7 +182,7 @@ const std::string uuid{R"([0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-
// from http://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address
const std::string hostname{R"(^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$)"};
bool is_ascii(std::string const& value)
bool is_ascii(std::string const &value)
{
for (auto ch : value) {
if (ch & 0x80) {

View File

@ -74,7 +74,7 @@
"description": "forbidden property",
"schema": {
"properties": {
"foo": {
"foo": {
"not": {}
}
}

View File

@ -334,7 +334,7 @@
"tests": [
{
"description": "valid tree",
"data": {
"data": {
"meta": "root",
"nodes": [
{
@ -363,7 +363,7 @@
},
{
"description": "invalid tree",
"data": {
"data": {
"meta": "root",
"nodes": [
{

View File

@ -149,7 +149,7 @@ int main()
// TODO when we set `string` in array and set `contentEncoding` = "binary" - what it means? We expected string or binary?
// Or we expect only binary? Now if you set `contentEncoding` = "binary", then it means that you expect only binary data,
// not string
//val.validate({{"something", "string"}}, err); -> produce error about type
// val.validate({{"something", "string"}}, err); -> produce error about type
EXPECT_EQ(err.failed_pointers.size(), 0);
err.reset();

View File

@ -119,7 +119,7 @@ int main(void)
{"age", 42},
{"name", "John"},
{"phones", {0}},
{"post-code", 12345},
{"post-code", 12345},
},
err); // name must be a string
EXPECT_EQ(err.failed_pointers.size(), 1);

View File

@ -64,7 +64,7 @@ auto schema_draft = R"(
urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f
urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f#
http://example.com/root.json#/definitions/C
*/
*/
auto schema = R"(
{

View File

@ -102,7 +102,7 @@ int main(void)
const auto &readPath = single_op["path"].get<std::string>();
if (readPath != "/address/street") {
std::cerr << "Patch with defaults contains wrong path. It is " << readPath << " and should be "
<< "/address/street" << std::endl;
<< "/address/street" << std::endl;
return 1;
}
@ -156,7 +156,7 @@ int main(void)
const auto &readPath = single_op["path"].get<std::string>();
if (readPath != "/address") {
std::cerr << "Patch with defaults contains wrong path. It is " << readPath << " and should be "
<< "/address" << std::endl;
<< "/address" << std::endl;
return 1;
}
@ -165,7 +165,7 @@ int main(void)
return 1;
}
if ( !single_op["value"].is_object() || !single_op["value"].empty()) {
if (!single_op["value"].is_object() || !single_op["value"].empty()) {
std::cerr << "Patch with defaults contains wrong value" << std::endl;
return 1;
}

View File

@ -4,5 +4,3 @@ add_test_simple_schema(Issue::27
set_tests_properties(Issue::27
PROPERTIES
WILL_FAIL 1)

View File

@ -112,7 +112,7 @@ int main(void)
{"age", 42},
{"name", "John"},
{"phones", {0}},
{"post-code", 12345},
{"post-code", 12345},
},
err); // name must be a string
EXPECT_EQ(err.failed_pointers.size(), 1);

View File

@ -10,4 +10,4 @@
"type": "string"
}
}
}
}

View File

@ -10,4 +10,4 @@
"type": "string"
}
}
}
}

View File

@ -20,29 +20,29 @@ using nlohmann::json_patch;
code; \
std::cerr << "UNEXPECTED SUCCESS.\n"; \
return 1; \
} catch (const std::exception &e) { \
} catch (const std::exception &e) { \
std::cerr << "EXPECTED FAIL: " << e.what() << "\n"; \
} \
} while (0)
int main(void)
{
OK( json_patch p1( R"([{"op":"add","path":"/0/renderable/bg","value":"Black"}])"_json));
OK( json_patch p1( R"([{"op":"replace","path":"/0/renderable/bg","value":"Black"}])"_json));
OK( json_patch p1( R"([{"op":"remove","path":"/0/renderable/bg"}])"_json));
OK(json_patch p1(R"([{"op":"add","path":"/0/renderable/bg","value":"Black"}])"_json));
OK(json_patch p1(R"([{"op":"replace","path":"/0/renderable/bg","value":"Black"}])"_json));
OK(json_patch p1(R"([{"op":"remove","path":"/0/renderable/bg"}])"_json));
// value not needed
KO( json_patch p1( R"([{"op":"remove","path":"/0/renderable/bg", "value":"Black"}])"_json));
KO(json_patch p1(R"([{"op":"remove","path":"/0/renderable/bg", "value":"Black"}])"_json));
// value missing
KO( json_patch p1( R"([{"op":"add","path":"/0/renderable/bg"}])"_json));
KO(json_patch p1(R"([{"op":"add","path":"/0/renderable/bg"}])"_json));
// value missing
KO( json_patch p1( R"([{"op":"replace","path":"/0/renderable/bg"}])"_json));
KO(json_patch p1(R"([{"op":"replace","path":"/0/renderable/bg"}])"_json));
// wrong op
KO( json_patch p1( R"([{"op":"ad","path":"/0/renderable/bg","value":"Black"}])"_json));
KO(json_patch p1(R"([{"op":"ad","path":"/0/renderable/bg","value":"Black"}])"_json));
// invalid json-pointer
KO( json_patch p1( R"([{"op":"add","path":"0/renderable/bg","value":"Black"}])"_json));
KO(json_patch p1(R"([{"op":"add","path":"0/renderable/bg","value":"Black"}])"_json));
return 0;
}