mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-03 08:46:46 +00:00
chore: Apply clang-format width 100 (#6387)
This commit is contained in:
@@ -336,7 +336,22 @@ class STParsedJSON_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(obj.object->isFieldPresent(sfEmailHash));
|
||||
BEAST_EXPECT(obj.object->getFieldH128(sfEmailHash).size() == 16);
|
||||
std::array<uint8_t, 16> expected = {
|
||||
0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
|
||||
0x01,
|
||||
0x23,
|
||||
0x45,
|
||||
0x67,
|
||||
0x89,
|
||||
0xAB,
|
||||
0xCD,
|
||||
0xEF,
|
||||
0x01,
|
||||
0x23,
|
||||
0x45,
|
||||
0x67,
|
||||
0x89,
|
||||
0xAB,
|
||||
0xCD,
|
||||
0xEF};
|
||||
BEAST_EXPECT(obj.object->getFieldH128(sfEmailHash) == uint128{expected});
|
||||
}
|
||||
|
||||
@@ -423,8 +438,9 @@ class STParsedJSON_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(obj.object.has_value());
|
||||
BEAST_EXPECT(obj.object->isFieldPresent(sfTakerPaysCurrency));
|
||||
BEAST_EXPECT(obj.object->getFieldH160(sfTakerPaysCurrency).size() == 20);
|
||||
std::array<uint8_t, 20> expected = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, 0x01, 0x23,
|
||||
0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, 0x01, 0x23, 0x45, 0x67};
|
||||
std::array<uint8_t, 20> expected = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD,
|
||||
0xEF, 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB,
|
||||
0xCD, 0xEF, 0x01, 0x23, 0x45, 0x67};
|
||||
BEAST_EXPECT(obj.object->getFieldH160(sfTakerPaysCurrency) == uint160{expected});
|
||||
}
|
||||
// Valid lowercase hex string for UInt160
|
||||
@@ -502,8 +518,9 @@ class STParsedJSON_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(obj.object.has_value());
|
||||
BEAST_EXPECT(obj.object->isFieldPresent(sfMPTokenIssuanceID));
|
||||
BEAST_EXPECT(obj.object->getFieldH192(sfMPTokenIssuanceID).size() == 24);
|
||||
std::array<uint8_t, 24> expected = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
||||
std::array<uint8_t, 24> expected = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
||||
BEAST_EXPECT(obj.object->getFieldH192(sfMPTokenIssuanceID) == uint192{expected});
|
||||
}
|
||||
|
||||
@@ -593,9 +610,10 @@ class STParsedJSON_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(obj.object.has_value());
|
||||
BEAST_EXPECT(obj.object->isFieldPresent(sfLedgerHash));
|
||||
BEAST_EXPECT(obj.object->getFieldH256(sfLedgerHash).size() == 32);
|
||||
std::array<uint8_t, 32> expected = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, 0x01, 0x23, 0x45,
|
||||
0x67, 0x89, 0xAB, 0xCD, 0xEF, 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB,
|
||||
0xCD, 0xEF, 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
|
||||
std::array<uint8_t, 32> expected = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
|
||||
0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
|
||||
0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
|
||||
0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
|
||||
BEAST_EXPECT(obj.object->getFieldH256(sfLedgerHash) == uint256{expected});
|
||||
}
|
||||
// Valid lowercase hex string for UInt256
|
||||
@@ -709,7 +727,8 @@ class STParsedJSON_test : public beast::unit_test::suite
|
||||
STParsedJSONObject obj("Test", j);
|
||||
BEAST_EXPECT(obj.object.has_value());
|
||||
if (BEAST_EXPECT(obj.object->isFieldPresent(sfLoanScale)))
|
||||
BEAST_EXPECT(obj.object->getFieldI32(sfLoanScale) == static_cast<int32_t>(maxUInt32));
|
||||
BEAST_EXPECT(
|
||||
obj.object->getFieldI32(sfLoanScale) == static_cast<int32_t>(maxUInt32));
|
||||
}
|
||||
|
||||
// Test with string value
|
||||
@@ -1197,9 +1216,13 @@ class STParsedJSON_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(!ps.empty());
|
||||
BEAST_EXPECT(ps.size() == 1);
|
||||
BEAST_EXPECT(ps[0].size() == 1);
|
||||
BEAST_EXPECT(ps[0][0].getAccountID() == parseBase58<AccountID>("rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"));
|
||||
BEAST_EXPECT(
|
||||
ps[0][0].getAccountID() ==
|
||||
parseBase58<AccountID>("rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"));
|
||||
BEAST_EXPECT(to_string(ps[0][0].getCurrency()) == "USD");
|
||||
BEAST_EXPECT(ps[0][0].getIssuerID() == parseBase58<AccountID>("rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe"));
|
||||
BEAST_EXPECT(
|
||||
ps[0][0].getIssuerID() ==
|
||||
parseBase58<AccountID>("rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1374,7 +1397,8 @@ class STParsedJSON_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(issue.currency.size() == 20);
|
||||
BEAST_EXPECT(to_string(issue.currency) == "USD");
|
||||
BEAST_EXPECT(issue.account.size() == 20);
|
||||
BEAST_EXPECT(issue.account == parseBase58<AccountID>("rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"));
|
||||
BEAST_EXPECT(
|
||||
issue.account == parseBase58<AccountID>("rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2013,7 +2037,8 @@ class STParsedJSON_test : public beast::unit_test::suite
|
||||
STParsedJSONObject parsed("test", jv);
|
||||
if (BEAST_EXPECT(parsed.object))
|
||||
{
|
||||
std::string const& serialized(to_string(parsed.object->getJson(JsonOptions::none)));
|
||||
std::string const& serialized(
|
||||
to_string(parsed.object->getJson(JsonOptions::none)));
|
||||
BEAST_EXPECT(serialized == goodJson);
|
||||
}
|
||||
}
|
||||
@@ -2036,7 +2061,8 @@ class STParsedJSON_test : public beast::unit_test::suite
|
||||
STParsedJSONObject parsed("test", jv);
|
||||
if (BEAST_EXPECT(parsed.object))
|
||||
{
|
||||
std::string const& serialized(to_string(parsed.object->getJson(JsonOptions::none)));
|
||||
std::string const& serialized(
|
||||
to_string(parsed.object->getJson(JsonOptions::none)));
|
||||
BEAST_EXPECT(serialized == expectedJson);
|
||||
}
|
||||
}
|
||||
@@ -2059,7 +2085,8 @@ class STParsedJSON_test : public beast::unit_test::suite
|
||||
STParsedJSONObject parsed("test", jv);
|
||||
if (BEAST_EXPECT(parsed.object))
|
||||
{
|
||||
std::string const& serialized(to_string(parsed.object->getJson(JsonOptions::none)));
|
||||
std::string const& serialized(
|
||||
to_string(parsed.object->getJson(JsonOptions::none)));
|
||||
BEAST_EXPECT(serialized == expectedJson);
|
||||
}
|
||||
}
|
||||
@@ -2077,7 +2104,9 @@ class STParsedJSON_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(!parsed.object);
|
||||
BEAST_EXPECT(parsed.error);
|
||||
BEAST_EXPECT(parsed.error[jss::error] == "invalidParams");
|
||||
BEAST_EXPECT(parsed.error[jss::error_message] == "Field 'test.TransactionResult' is out of range.");
|
||||
BEAST_EXPECT(
|
||||
parsed.error[jss::error_message] ==
|
||||
"Field 'test.TransactionResult' is out of range.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2093,7 +2122,8 @@ class STParsedJSON_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(!parsed.object);
|
||||
BEAST_EXPECT(parsed.error);
|
||||
BEAST_EXPECT(parsed.error[jss::error] == "invalidParams");
|
||||
BEAST_EXPECT(parsed.error[jss::error_message] == "Field 'test.Method' has bad type.");
|
||||
BEAST_EXPECT(
|
||||
parsed.error[jss::error_message] == "Field 'test.Method' has bad type.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2109,7 +2139,8 @@ class STParsedJSON_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(!parsed.object);
|
||||
BEAST_EXPECT(parsed.error);
|
||||
BEAST_EXPECT(parsed.error[jss::error] == "invalidParams");
|
||||
BEAST_EXPECT(parsed.error[jss::error_message] == "Field 'test.Method' is out of range.");
|
||||
BEAST_EXPECT(
|
||||
parsed.error[jss::error_message] == "Field 'test.Method' is out of range.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2125,7 +2156,9 @@ class STParsedJSON_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(!parsed.object);
|
||||
BEAST_EXPECT(parsed.error);
|
||||
BEAST_EXPECT(parsed.error[jss::error] == "invalidParams");
|
||||
BEAST_EXPECT(parsed.error[jss::error_message] == "Field 'test.CloseResolution' is out of range.");
|
||||
BEAST_EXPECT(
|
||||
parsed.error[jss::error_message] ==
|
||||
"Field 'test.CloseResolution' is out of range.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2141,7 +2174,8 @@ class STParsedJSON_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(!parsed.object);
|
||||
BEAST_EXPECT(parsed.error);
|
||||
BEAST_EXPECT(parsed.error[jss::error] == "invalidParams");
|
||||
BEAST_EXPECT(parsed.error[jss::error_message] == "Field 'test.Method' has bad type.");
|
||||
BEAST_EXPECT(
|
||||
parsed.error[jss::error_message] == "Field 'test.Method' has bad type.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2159,7 +2193,8 @@ class STParsedJSON_test : public beast::unit_test::suite
|
||||
STParsedJSONObject parsed("test", jv);
|
||||
if (BEAST_EXPECT(parsed.object))
|
||||
{
|
||||
std::string const& serialized(to_string(parsed.object->getJson(JsonOptions::none)));
|
||||
std::string const& serialized(
|
||||
to_string(parsed.object->getJson(JsonOptions::none)));
|
||||
BEAST_EXPECT(serialized == expectedJson);
|
||||
}
|
||||
}
|
||||
@@ -2177,7 +2212,9 @@ class STParsedJSON_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(!parsed.object);
|
||||
BEAST_EXPECT(parsed.error);
|
||||
BEAST_EXPECT(parsed.error[jss::error] == "invalidParams");
|
||||
BEAST_EXPECT(parsed.error[jss::error_message] == "Field 'test.TransferFee' has invalid data.");
|
||||
BEAST_EXPECT(
|
||||
parsed.error[jss::error_message] ==
|
||||
"Field 'test.TransferFee' has invalid data.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2193,7 +2230,9 @@ class STParsedJSON_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(!parsed.object);
|
||||
BEAST_EXPECT(parsed.error);
|
||||
BEAST_EXPECT(parsed.error[jss::error] == "invalidParams");
|
||||
BEAST_EXPECT(parsed.error[jss::error_message] == "Field 'test.TransferFee' has invalid data.");
|
||||
BEAST_EXPECT(
|
||||
parsed.error[jss::error_message] ==
|
||||
"Field 'test.TransferFee' has invalid data.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2209,7 +2248,8 @@ class STParsedJSON_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(!parsed.object);
|
||||
BEAST_EXPECT(parsed.error);
|
||||
BEAST_EXPECT(parsed.error[jss::error] == "invalidParams");
|
||||
BEAST_EXPECT(parsed.error[jss::error_message] == "Field 'test.TransferFee' has bad type.");
|
||||
BEAST_EXPECT(
|
||||
parsed.error[jss::error_message] == "Field 'test.TransferFee' has bad type.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user