You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-08 14:02:17 +03:00
More test fixes:
Always provide a message to the FAIL_ macros
This commit is contained in:
@@ -100,7 +100,7 @@ int bug_10214(MYSQL *mysql)
|
||||
check_mysql_rc(rc, mysql);
|
||||
|
||||
len= mysql_real_escape_string(mysql, out, "a'b\\c", 5);
|
||||
FAIL_IF(memcmp(out, "a\\'b\\\\c", len), NULL);
|
||||
FAIL_IF(memcmp(out, "a\\'b\\\\c", len), "wrong result");
|
||||
|
||||
rc= mysql_query(mysql, "set sql_mode='NO_BACKSLASH_ESCAPES'");
|
||||
check_mysql_rc(rc, mysql);
|
||||
|
@@ -934,7 +934,7 @@ static int test_sess_track_db(MYSQL *mysql)
|
||||
int rc;
|
||||
const char *data;
|
||||
size_t len;
|
||||
char stmt[512];
|
||||
char tmp_str[512];
|
||||
|
||||
|
||||
if (!(mysql->server_capabilities & CLIENT_SESSION_TRACKING))
|
||||
@@ -951,14 +951,17 @@ static int test_sess_track_db(MYSQL *mysql)
|
||||
"session_track_get_first failed");
|
||||
FAIL_IF(strncmp(data, "mysql", len), "Expected new schema 'mysql'");
|
||||
|
||||
sprintf(stmt, "USE %s", schema);
|
||||
rc= mysql_query(mysql, stmt);
|
||||
sprintf(tmp_str, "USE %s", schema);
|
||||
rc= mysql_query(mysql, tmp_str);
|
||||
check_mysql_rc(rc, mysql);
|
||||
FAIL_IF(strcmp(mysql->db, schema), "Expected new schema 'test'");
|
||||
|
||||
sprintf(tmp_str, "Expected new schema '%s'.", schema);
|
||||
|
||||
FAIL_IF(strcmp(mysql->db, schema), tmp_str);
|
||||
|
||||
FAIL_IF(mysql_session_track_get_first(mysql, SESSION_TRACK_SCHEMA, &data, &len),
|
||||
"session_track_get_first failed");
|
||||
FAIL_IF(strncmp(data, "test", len), "Expected new schema 'test'");
|
||||
FAIL_IF(strncmp(data, schema, len), tmp_str);
|
||||
|
||||
if (mysql_get_server_version(mysql) >= 100300)
|
||||
{
|
||||
|
@@ -115,7 +115,7 @@ do {\
|
||||
do {\
|
||||
if (expr)\
|
||||
{\
|
||||
diag("Error: %s (%s: %d)", (reason) ? reason : "", __FILE__, __LINE__);\
|
||||
diag("Error: %s (%s: %d)", reason, __FILE__, __LINE__);\
|
||||
return FAIL;\
|
||||
}\
|
||||
} while(0)
|
||||
|
Reference in New Issue
Block a user