MXS-2900 Add parameter checking to tprintf-function

This commit is contained in:
Esa Korhonen 2020-08-13 22:38:21 +03:00
parent 5abdb91e9d
commit b31cb20bae
10 changed files with 10 additions and 10 deletions

View File

@ -118,7 +118,7 @@ int main(int argc, char* argv[])
Test->maxscales->password,
NULL);
Test->tprintf("Dropping user", Test->maxscales->user_name);
Test->tprintf("Dropping user");
Test->try_query(Test->maxscales->conn_rwsplit[0], (char*) "DROP USER user@'%%';");
Test->check_maxscale_alive(0);

View File

@ -122,7 +122,7 @@ int main(int argc, char *argv[])
{
data[j][i].sql = (char*) malloc((i +1) * 32 * 14 + 32);
create_insert_string(data[j][i].sql, (i + 1) * 32, i);
Test->tprintf("sqL %d: %d\n", i, strlen(data[j][i].sql));
Test->tprintf("sqL %d: %zu\n", i, strlen(data[j][i].sql));
data[j][i].exit_flag = false;
data[j][i].id = i;
pthread_create(&thread_id[j][i], NULL, thread[j], &data[j][i]);

View File

@ -349,7 +349,7 @@ public:
/**
* @brief printf with automatic timestamps
*/
void tprintf(const char* format, ...);
void tprintf(const char* format, ...) mxb_attribute((format(printf, 2, 3)));
/**
* @brief Creats t1 table, insert data into it and checks if data can be correctly read from all Maxscale

View File

@ -102,7 +102,7 @@ void load(long int* new_inserts,
Test->tprintf("COM_INSERT and COM_SELECT after executing test\n");
get_global_status_allnodes(&new_selects[0], &new_inserts[0], nodes, 0);
print_delta(&new_selects[0], &new_inserts[0], &selects[0], &inserts[0], nodes->N);
Test->tprintf("First group of threads did %d queries, second - %d \n", data.i1, data.i2);
Test->tprintf("First group of threads did %ld queries, second - %ld \n", data.i1, data.i2);
}
nodes->close_connections();
*i1 = data.i1;

View File

@ -55,7 +55,7 @@ int test_longblob(TestConnections* Test,
Test->tprintf("Sending data in %d bytes chunks, total size is %d\n",
Test->tprintf("Sending data in %lu bytes chunks, total size is %lu\n",
size * sizeof(unsigned long),
(size * sizeof(unsigned long)) * chunks);
for (i = 0; i < chunks; i++)

View File

@ -626,7 +626,7 @@ void TestConnections::read_mdbci_info()
}
if (verbose)
{
tprintf(m_network_config.c_str());
tprintf("%s", m_network_config.c_str());
}
}

View File

@ -27,7 +27,7 @@ int main(int argc, char** argv)
}
test.tprintf("Done!");
test.tprintf("Opening a connection with each database as the default database...", db_list.size());
test.tprintf("Opening a connection with each database as the default database...");
std::set<std::string> errors;
for (auto db : db_list)

View File

@ -55,7 +55,7 @@ void tune_rowcount(TestConnections& test)
int orig = ROWCOUNT;
ROWCOUNT = orig / dur.count() * 10000;
test.tprintf("Loading %d rows took %d ms, setting row count to %d",
test.tprintf("Loading %d rows took %ld ms, setting row count to %d",
orig,
dur.count(),
ROWCOUNT.load());

View File

@ -120,7 +120,7 @@ int main(int argc, char** argv)
auto end = std::chrono::steady_clock::now();
test.tprintf("A total of %d connections were created over %d seconds",
test.tprintf("A total of %d connections were created over %ld seconds",
conns.load(),
std::chrono::duration_cast<std::chrono::seconds>(end - start).count());

View File

@ -31,7 +31,7 @@ void run_test(TestConnections& test, size_t size, int chunks)
mysql_stmt_error(stmt));
std::string data(size, '.');
test.tprintf("Sending %d x %d bytes of data", size, chunks);
test.tprintf("Sending %zu x %d bytes of data", size, chunks);
for (int i = 0; i < chunks; i++)
{