mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-06 17:27:58 +00:00
@@ -30,8 +30,6 @@ using namespace std;
|
||||
|
||||
using namespace data::cassandra;
|
||||
|
||||
namespace json = boost::json;
|
||||
|
||||
class BackendCassandraBaseTest : public NoLoggerFixture
|
||||
{
|
||||
protected:
|
||||
@@ -88,7 +86,7 @@ protected:
|
||||
int64_t idx = 1000;
|
||||
|
||||
for (auto const& entry : entries)
|
||||
statements.push_back(insert.bind(entry, static_cast<int64_t>(idx++)));
|
||||
statements.push_back(insert.bind(entry, idx++));
|
||||
|
||||
EXPECT_EQ(statements.size(), entries.size());
|
||||
EXPECT_TRUE(handle.execute(statements));
|
||||
@@ -241,9 +239,11 @@ TEST_F(BackendCassandraBaseTest, CreateTableWithStrings)
|
||||
)",
|
||||
5000);
|
||||
|
||||
auto const f1 = handle.asyncExecute(q1);
|
||||
auto const rc = f1.await();
|
||||
ASSERT_TRUE(rc) << rc.error();
|
||||
{
|
||||
auto const f1 = handle.asyncExecute(q1);
|
||||
auto const rc = f1.await();
|
||||
ASSERT_TRUE(rc) << rc.error();
|
||||
}
|
||||
|
||||
std::string q2 = "INSERT INTO strings (hash, sequence) VALUES (?, ?)";
|
||||
auto insert = handle.prepare(q2);
|
||||
@@ -254,7 +254,7 @@ TEST_F(BackendCassandraBaseTest, CreateTableWithStrings)
|
||||
int64_t idx = 1000;
|
||||
|
||||
for (auto const& entry : entries)
|
||||
futures.push_back(handle.asyncExecute(insert, entry, static_cast<int64_t>(idx++)));
|
||||
futures.push_back(handle.asyncExecute(insert, entry, idx++));
|
||||
|
||||
ASSERT_EQ(futures.size(), entries.size());
|
||||
for (auto const& f : futures)
|
||||
@@ -302,9 +302,11 @@ TEST_F(BackendCassandraBaseTest, BatchInsert)
|
||||
WITH default_time_to_live = {}
|
||||
)",
|
||||
5000);
|
||||
auto const f1 = handle.asyncExecute(q1);
|
||||
auto const rc = f1.await();
|
||||
ASSERT_TRUE(rc) << rc.error();
|
||||
{
|
||||
auto const f1 = handle.asyncExecute(q1);
|
||||
auto const rc = f1.await();
|
||||
ASSERT_TRUE(rc) << rc.error();
|
||||
}
|
||||
|
||||
std::string q2 = "INSERT INTO strings (hash, sequence) VALUES (?, ?)";
|
||||
auto const insert = handle.prepare(q2);
|
||||
@@ -315,7 +317,7 @@ TEST_F(BackendCassandraBaseTest, BatchInsert)
|
||||
int64_t idx = 1000;
|
||||
|
||||
for (auto const& entry : entries)
|
||||
statements.push_back(insert.bind(entry, static_cast<int64_t>(idx++)));
|
||||
statements.push_back(insert.bind(entry, idx++));
|
||||
|
||||
ASSERT_EQ(statements.size(), entries.size());
|
||||
|
||||
@@ -374,7 +376,7 @@ TEST_F(BackendCassandraBaseTest, BatchInsertAsync)
|
||||
int64_t idx = 1000;
|
||||
|
||||
for (auto const& entry : entries)
|
||||
statements.push_back(insert.bind(entry, static_cast<int64_t>(idx++)));
|
||||
statements.push_back(insert.bind(entry, idx++));
|
||||
|
||||
ASSERT_EQ(statements.size(), entries.size());
|
||||
fut.emplace(handle.asyncExecute(statements, [&](auto const res) {
|
||||
@@ -434,8 +436,7 @@ TEST_F(BackendCassandraBaseTest, AlterTableMoveToNewTable)
|
||||
{
|
||||
static_assert(std::is_same_v<decltype(hash), std::string>);
|
||||
static_assert(std::is_same_v<decltype(seq), int64_t>);
|
||||
migrationStatements.push_back(
|
||||
migrationInsert.bind(hash, static_cast<int64_t>(seq), static_cast<int64_t>(seq + 1u)));
|
||||
migrationStatements.push_back(migrationInsert.bind(hash, seq, seq + 1u));
|
||||
}
|
||||
|
||||
EXPECT_TRUE(handle.execute(migrationStatements));
|
||||
|
||||
Reference in New Issue
Block a user