mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Use std::size in place of std::extent
* Fixes RIPD-269
This commit is contained in:
committed by
manojsdoshi
parent
0290d0b82c
commit
2d23e7bd18
@@ -1871,9 +1871,7 @@ class AccountTxPaging_test : public beast::unit_test::suite
|
||||
if (!BEAST_EXPECT(status.error_code() == 0))
|
||||
return;
|
||||
|
||||
if (!BEAST_EXPECT(
|
||||
res.transactions().size() ==
|
||||
std::extent<decltype(txCheck)>::value))
|
||||
if (!BEAST_EXPECT(res.transactions().size() == std::size(txCheck)))
|
||||
return;
|
||||
for (int i = 0; i < res.transactions().size(); ++i)
|
||||
{
|
||||
|
||||
@@ -321,11 +321,8 @@ public:
|
||||
LedgerSeq BIGINT UNSIGNED \
|
||||
);",
|
||||
"CREATE INDEX SeqLedger ON Ledgers(LedgerSeq);"};
|
||||
int dbInitCount = std::extent<decltype(dbInit)>::value;
|
||||
for (int i = 0; i < dbInitCount; ++i)
|
||||
{
|
||||
s << dbInit[i];
|
||||
}
|
||||
for (auto const c : dbInit)
|
||||
s << c;
|
||||
char lh[65];
|
||||
memset(lh, 'a', 64);
|
||||
lh[64] = '\0';
|
||||
|
||||
@@ -445,12 +445,9 @@ class AccountTx_test : public beast::unit_test::suite
|
||||
// clang-format on
|
||||
|
||||
BEAST_EXPECT(
|
||||
std::extent<decltype(sanity)>::value ==
|
||||
result[jss::result][jss::transactions].size());
|
||||
std::size(sanity) == result[jss::result][jss::transactions].size());
|
||||
|
||||
for (unsigned int index{0};
|
||||
index < std::extent<decltype(sanity)>::value;
|
||||
++index)
|
||||
for (unsigned int index{0}; index < std::size(sanity); ++index)
|
||||
{
|
||||
checkSanity(txs[index], sanity[index]);
|
||||
}
|
||||
@@ -531,14 +528,14 @@ class AccountTx_test : public beast::unit_test::suite
|
||||
// The first two transactions listed in sanity haven't happened yet.
|
||||
constexpr unsigned int beckyDeletedOffest = 2;
|
||||
BEAST_EXPECT(
|
||||
std::extent<decltype(sanity)>::value ==
|
||||
std::size(sanity) ==
|
||||
result[jss::result][jss::transactions].size() +
|
||||
beckyDeletedOffest);
|
||||
|
||||
Json::Value const& txs{result[jss::result][jss::transactions]};
|
||||
|
||||
for (unsigned int index = beckyDeletedOffest;
|
||||
index < std::extent<decltype(sanity)>::value;
|
||||
index < std::size(sanity);
|
||||
++index)
|
||||
{
|
||||
checkSanity(txs[index - beckyDeletedOffest], sanity[index]);
|
||||
@@ -576,14 +573,11 @@ class AccountTx_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(result[jss::result][jss::transactions].isArray());
|
||||
|
||||
BEAST_EXPECT(
|
||||
std::extent<decltype(sanity)>::value ==
|
||||
result[jss::result][jss::transactions].size());
|
||||
std::size(sanity) == result[jss::result][jss::transactions].size());
|
||||
|
||||
Json::Value const& txs{result[jss::result][jss::transactions]};
|
||||
|
||||
for (unsigned int index = 0;
|
||||
index < std::extent<decltype(sanity)>::value;
|
||||
++index)
|
||||
for (unsigned int index = 0; index < std::size(sanity); ++index)
|
||||
{
|
||||
checkSanity(txs[index], sanity[index]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user