7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi#ifndef DRIVER_TEST_H
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi#define DRIVER_TEST_H 1
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomistruct test_driver_result_set {
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi size_t rows, cols, cur;
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi const char *const *col_names;
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi const char ***row_data;
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi};
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomistruct test_driver_result {
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi /* expected queries */
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi size_t nqueries;
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi size_t cur;
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi unsigned int affected_rows;
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi const char *const *queries;
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi /* test result, rows and columns */
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi struct test_driver_result_set *result;
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi};
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomivoid sql_driver_test_register(void);
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomivoid sql_driver_test_unregister(void);
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomivoid sql_driver_test_add_expected_result(struct sql_db *_db,
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi const struct test_driver_result *result);
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomivoid sql_driver_test_clear_expected_results(struct sql_db *_db);
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi
7b1ce34143ee2c47bf4d2bff73f9cd6e763fadc0Aki Tuomi#endif