Rename TestConnections::assert() to TestConnections::expect()
Allows the including of <assert.h>.
This commit is contained in:
@ -62,7 +62,7 @@ int main(int argc, char** argv)
|
||||
mysql_query(nodes[i], RESET_SLAVE) != 0 ||
|
||||
mysql_query(nodes[i], READ_ONLY_OFF) != 0)
|
||||
{
|
||||
test.assert(false, "Could not stop slave connections and/or disable read_only for node %d.", i);
|
||||
test.expect(false, "Could not stop slave connections and/or disable read_only for node %d.", i);
|
||||
return test.global_result;
|
||||
}
|
||||
}
|
||||
@ -82,7 +82,7 @@ int main(int argc, char** argv)
|
||||
}
|
||||
print_gtids(test);
|
||||
bool gtids_ok = (gtid_begin == gtid_node2 && gtid_node2 < gtid_node3);
|
||||
test.assert(gtids_ok, "Gtid:s have not advanced correctly.");
|
||||
test.expect(gtids_ok, "Gtid:s have not advanced correctly.");
|
||||
if (!gtids_ok)
|
||||
{
|
||||
return test.global_result;
|
||||
@ -101,8 +101,8 @@ int main(int argc, char** argv)
|
||||
StringSet node3_states = test.get_server_status("server4");
|
||||
bool states_n2_ok = (node2_states.find("Slave") != node2_states.end());
|
||||
bool states_n3_ok = (node3_states.find("Slave") == node3_states.end());
|
||||
test.assert(states_n2_ok, "Node 2 has not rejoined when it should have.");
|
||||
test.assert(states_n3_ok, "Node 3 rejoined when it shouldn't have.");
|
||||
test.expect(states_n2_ok, "Node 2 has not rejoined when it should have.");
|
||||
test.expect(states_n3_ok, "Node 3 rejoined when it shouldn't have.");
|
||||
if (!states_n2_ok || !states_n3_ok)
|
||||
{
|
||||
return test.global_result;
|
||||
@ -122,11 +122,11 @@ int main(int argc, char** argv)
|
||||
test.maxscales->wait_for_monitor();
|
||||
get_output(test);
|
||||
int master_id = get_master_server_id(test);
|
||||
test.assert(master_id == 4, "Server 4 should be the cluster master.");
|
||||
test.expect(master_id == 4, "Server 4 should be the cluster master.");
|
||||
StringSet node0_states = test.get_server_status("server1");
|
||||
bool states_n0_ok = (node0_states.find("Slave") != node0_states.end() &&
|
||||
node0_states.find("Relay Master") == node0_states.end());
|
||||
test.assert(states_n0_ok, "Server 1 is not a slave when it should be.");
|
||||
test.expect(states_n0_ok, "Server 1 is not a slave when it should be.");
|
||||
if (states_n0_ok)
|
||||
{
|
||||
int ec;
|
||||
@ -134,7 +134,7 @@ int main(int argc, char** argv)
|
||||
"maxadmin call command mysqlmon switchover MySQL-Monitor server1 server4" , true, &ec);
|
||||
test.maxscales->wait_for_monitor();
|
||||
master_id = get_master_server_id(test);
|
||||
test.assert(master_id == 1, "Server 1 should be the cluster master.");
|
||||
test.expect(master_id == 1, "Server 1 should be the cluster master.");
|
||||
get_output(test);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user