Rename TestConnections::assert() to TestConnections::expect()

Allows the including of <assert.h>.
This commit is contained in:
Johan Wikman
2018-09-10 10:24:46 +03:00
parent bcacdf9358
commit 6279ab350c
38 changed files with 117 additions and 117 deletions

View File

@ -36,15 +36,15 @@ int main(int argc, char** argv)
test.tprintf("Connect with a user that has a default role");
MYSQL* conn = open_conn_db(test.maxscales->rwsplit_port[0], test.maxscales->IP[0], "my_db", "test", "test");
test.assert(mysql_errno(conn) == 0, "Connection failed: %s", mysql_error(conn));
test.expect(mysql_errno(conn) == 0, "Connection failed: %s", mysql_error(conn));
char value[100] {};
find_field(conn, "SELECT CURRENT_ROLE() AS role", "role", value);
test.assert(strcmp(value, "dba") == 0, "Current role should be 'dba' but is: %s", value);
test.expect(strcmp(value, "dba") == 0, "Current role should be 'dba' but is: %s", value);
mysql_close(conn);
test.tprintf("Connect with a user that doesn't have a default role, expect failure");
conn = open_conn_db(test.maxscales->rwsplit_port[0], test.maxscales->IP[0], "my_db", "test2", "test2");
test.assert(mysql_errno(conn) != 0, "Connection should fail");
test.expect(mysql_errno(conn) != 0, "Connection should fail");
mysql_close(conn);
// Cleanup