Apply pre-commit fixes
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
This commit is contained in:
parent
143b0f6696
commit
fe780a7fa3
@ -1,17 +1,14 @@
|
|||||||
---
|
BasedOnStyle: LLVM
|
||||||
BasedOnStyle: LLVM
|
|
||||||
AccessModifierOffset: -2
|
|
||||||
#AlignConsecutiveAssignments: true
|
#AlignConsecutiveAssignments: true
|
||||||
#AlignConsecutiveDeclarations: true
|
#AlignConsecutiveDeclarations: true
|
||||||
AllowShortFunctionsOnASingleLine: Inline
|
AllowShortFunctionsOnASingleLine: Inline
|
||||||
BreakBeforeBraces: Linux
|
BreakBeforeBraces: Linux
|
||||||
ColumnLimit: 0
|
ColumnLimit: 0
|
||||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||||
IndentWidth: 4
|
IndentWidth: 4
|
||||||
IndentPPDirectives: AfterHash
|
IndentPPDirectives: AfterHash
|
||||||
ObjCBlockIndentWidth: 0
|
ObjCBlockIndentWidth: 0
|
||||||
SpaceAfterCStyleCast: true
|
SpaceAfterCStyleCast: true
|
||||||
TabWidth: 4
|
TabWidth: 4
|
||||||
AccessModifierOffset: -4
|
AccessModifierOffset: -4
|
||||||
UseTab: ForIndentation
|
UseTab: ForIndentation
|
||||||
...
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -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
|
#endif // SMTP_ADDRESS_PARSER_HPP_INCLUDED
|
||||||
|
|||||||
@ -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
|
// 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]))*$)"};
|
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) {
|
for (auto ch : value) {
|
||||||
if (ch & 0x80) {
|
if (ch & 0x80) {
|
||||||
|
|||||||
@ -74,7 +74,7 @@
|
|||||||
"description": "forbidden property",
|
"description": "forbidden property",
|
||||||
"schema": {
|
"schema": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"foo": {
|
"foo": {
|
||||||
"not": {}
|
"not": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -82,4 +82,4 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@ -334,7 +334,7 @@
|
|||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
"description": "valid tree",
|
"description": "valid tree",
|
||||||
"data": {
|
"data": {
|
||||||
"meta": "root",
|
"meta": "root",
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{
|
{
|
||||||
@ -363,7 +363,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "invalid tree",
|
"description": "invalid tree",
|
||||||
"data": {
|
"data": {
|
||||||
"meta": "root",
|
"meta": "root",
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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?
|
// 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,
|
// Or we expect only binary? Now if you set `contentEncoding` = "binary", then it means that you expect only binary data,
|
||||||
// not string
|
// 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);
|
EXPECT_EQ(err.failed_pointers.size(), 0);
|
||||||
err.reset();
|
err.reset();
|
||||||
|
|
||||||
|
|||||||
@ -119,7 +119,7 @@ int main(void)
|
|||||||
{"age", 42},
|
{"age", 42},
|
||||||
{"name", "John"},
|
{"name", "John"},
|
||||||
{"phones", {0}},
|
{"phones", {0}},
|
||||||
{"post-code", 12345},
|
{"post-code", 12345},
|
||||||
},
|
},
|
||||||
err); // name must be a string
|
err); // name must be a string
|
||||||
EXPECT_EQ(err.failed_pointers.size(), 1);
|
EXPECT_EQ(err.failed_pointers.size(), 1);
|
||||||
|
|||||||
@ -64,7 +64,7 @@ auto schema_draft = R"(
|
|||||||
urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f
|
urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f
|
||||||
urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f#
|
urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f#
|
||||||
http://example.com/root.json#/definitions/C
|
http://example.com/root.json#/definitions/C
|
||||||
*/
|
*/
|
||||||
|
|
||||||
auto schema = R"(
|
auto schema = R"(
|
||||||
{
|
{
|
||||||
|
|||||||
@ -102,7 +102,7 @@ int main(void)
|
|||||||
const auto &readPath = single_op["path"].get<std::string>();
|
const auto &readPath = single_op["path"].get<std::string>();
|
||||||
if (readPath != "/address/street") {
|
if (readPath != "/address/street") {
|
||||||
std::cerr << "Patch with defaults contains wrong path. It is " << readPath << " and should be "
|
std::cerr << "Patch with defaults contains wrong path. It is " << readPath << " and should be "
|
||||||
<< "/address/street" << std::endl;
|
<< "/address/street" << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ int main(void)
|
|||||||
const auto &readPath = single_op["path"].get<std::string>();
|
const auto &readPath = single_op["path"].get<std::string>();
|
||||||
if (readPath != "/address") {
|
if (readPath != "/address") {
|
||||||
std::cerr << "Patch with defaults contains wrong path. It is " << readPath << " and should be "
|
std::cerr << "Patch with defaults contains wrong path. It is " << readPath << " and should be "
|
||||||
<< "/address" << std::endl;
|
<< "/address" << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ int main(void)
|
|||||||
return 1;
|
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;
|
std::cerr << "Patch with defaults contains wrong value" << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,5 +4,3 @@ add_test_simple_schema(Issue::27
|
|||||||
set_tests_properties(Issue::27
|
set_tests_properties(Issue::27
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
WILL_FAIL 1)
|
WILL_FAIL 1)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -112,7 +112,7 @@ int main(void)
|
|||||||
{"age", 42},
|
{"age", 42},
|
||||||
{"name", "John"},
|
{"name", "John"},
|
||||||
{"phones", {0}},
|
{"phones", {0}},
|
||||||
{"post-code", 12345},
|
{"post-code", 12345},
|
||||||
},
|
},
|
||||||
err); // name must be a string
|
err); // name must be a string
|
||||||
EXPECT_EQ(err.failed_pointers.size(), 1);
|
EXPECT_EQ(err.failed_pointers.size(), 1);
|
||||||
|
|||||||
@ -10,4 +10,4 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,4 +10,4 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,29 +20,29 @@ using nlohmann::json_patch;
|
|||||||
code; \
|
code; \
|
||||||
std::cerr << "UNEXPECTED SUCCESS.\n"; \
|
std::cerr << "UNEXPECTED SUCCESS.\n"; \
|
||||||
return 1; \
|
return 1; \
|
||||||
} catch (const std::exception &e) { \
|
} catch (const std::exception &e) { \
|
||||||
std::cerr << "EXPECTED FAIL: " << e.what() << "\n"; \
|
std::cerr << "EXPECTED FAIL: " << e.what() << "\n"; \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
OK( json_patch p1( R"([{"op":"add","path":"/0/renderable/bg","value":"Black"}])"_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":"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":"remove","path":"/0/renderable/bg"}])"_json));
|
||||||
|
|
||||||
// value not needed
|
// 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
|
// 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
|
// 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
|
// 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
|
// 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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user