Uncrustify maxscale
See script directory for method. The script to run in the top level MaxScale directory is called maxscale-uncrustify.sh, which uses another script, list-src, from the same directory (so you need to set your PATH). The uncrustify version was 0.66.
This commit is contained in:
@ -25,9 +25,11 @@ void alter_readwritesplit(TestConnections& test)
|
||||
|
||||
// Check that writes work for both connections
|
||||
test.assert(first.query("SELECT @@last_insert_id"),
|
||||
"Write to first connection should work: %s", first.error());
|
||||
"Write to first connection should work: %s",
|
||||
first.error());
|
||||
test.assert(second.query("SELECT @@last_insert_id"),
|
||||
"Write to second connection should work: %s", second.error());
|
||||
"Write to second connection should work: %s",
|
||||
second.error());
|
||||
|
||||
// Block the master
|
||||
test.repl->block_node(0);
|
||||
@ -37,7 +39,8 @@ void alter_readwritesplit(TestConnections& test)
|
||||
test.assert(!first.query("SELECT 1"),
|
||||
"Read to first connection should fail.");
|
||||
test.assert(second.query("SELECT 1"),
|
||||
"Read to second connection should work: %s", second.error());
|
||||
"Read to second connection should work: %s",
|
||||
second.error());
|
||||
|
||||
// Unblock the master, restart Maxscale and check that changes are persisted
|
||||
test.repl->unblock_node(0);
|
||||
@ -46,13 +49,15 @@ void alter_readwritesplit(TestConnections& test)
|
||||
|
||||
third.connect();
|
||||
test.assert(third.query("SELECT @@last_insert_id"),
|
||||
"Write to third connection should work: %s", third.error());
|
||||
"Write to third connection should work: %s",
|
||||
third.error());
|
||||
|
||||
test.repl->block_node(0);
|
||||
test.maxscales->wait_for_monitor();
|
||||
|
||||
test.assert(third.query("SELECT 1"),
|
||||
"Read to third connection should work: %s", third.error());
|
||||
"Read to third connection should work: %s",
|
||||
third.error());
|
||||
|
||||
test.repl->unblock_node(0);
|
||||
test.maxscales->wait_for_monitor();
|
||||
@ -71,8 +76,10 @@ void alter_readconnroute(TestConnections& test)
|
||||
conn.connect();
|
||||
Row row = conn.row("SELECT @@server_id");
|
||||
conn.disconnect();
|
||||
test.assert(row[0] == master_id, "First connection should use master: %s != %s",
|
||||
row[0].c_str(), master_id.c_str());
|
||||
test.assert(row[0] == master_id,
|
||||
"First connection should use master: %s != %s",
|
||||
row[0].c_str(),
|
||||
master_id.c_str());
|
||||
}
|
||||
|
||||
test.check_maxctrl("alter service Read-Connection-Router-Master router_options slave");
|
||||
@ -82,8 +89,10 @@ void alter_readconnroute(TestConnections& test)
|
||||
conn.connect();
|
||||
Row row = conn.row("SELECT @@server_id");
|
||||
conn.disconnect();
|
||||
test.assert(row[0] != master_id, "Second connection should not use master: %s == %s",
|
||||
row[0].c_str(), master_id.c_str());
|
||||
test.assert(row[0] != master_id,
|
||||
"Second connection should not use master: %s == %s",
|
||||
row[0].c_str(),
|
||||
master_id.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@ -113,15 +122,15 @@ int main(int argc, char** argv)
|
||||
{
|
||||
TestConnections test(argc, argv);
|
||||
|
||||
std::vector<std::pair<const char*, std::function<void (TestConnections&)>>> tests =
|
||||
std::vector<std::pair<const char*, std::function<void(TestConnections&)>>> tests =
|
||||
{
|
||||
TEST(alter_readwritesplit),
|
||||
TEST(alter_readconnroute),
|
||||
TEST(alter_schemarouter),
|
||||
TEST(alter_unsupported)
|
||||
TEST(alter_readwritesplit),
|
||||
TEST(alter_readconnroute),
|
||||
TEST(alter_schemarouter),
|
||||
TEST(alter_unsupported)
|
||||
};
|
||||
|
||||
for (auto& a: tests)
|
||||
for (auto& a : tests)
|
||||
{
|
||||
std::cout << a.first << std::endl;
|
||||
a.second(test);
|
||||
|
||||
Reference in New Issue
Block a user