summaryrefslogtreecommitdiffstats
path: root/src/lib-sql/driver-test.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:36:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:36:47 +0000
commit0441d265f2bb9da249c7abf333f0f771fadb4ab5 (patch)
tree3f3789daa2f6db22da6e55e92bee0062a7d613fe /src/lib-sql/driver-test.h
parentInitial commit. (diff)
downloaddovecot-0441d265f2bb9da249c7abf333f0f771fadb4ab5.tar.xz
dovecot-0441d265f2bb9da249c7abf333f0f771fadb4ab5.zip
Adding upstream version 1:2.3.21+dfsg1.upstream/1%2.3.21+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/lib-sql/driver-test.h')
-rw-r--r--src/lib-sql/driver-test.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/lib-sql/driver-test.h b/src/lib-sql/driver-test.h
new file mode 100644
index 0000000..49915ad
--- /dev/null
+++ b/src/lib-sql/driver-test.h
@@ -0,0 +1,28 @@
+#ifndef DRIVER_TEST_H
+#define DRIVER_TEST_H 1
+
+struct test_driver_result_set {
+ size_t rows, cols, cur;
+ const char *const *col_names;
+ const char ***row_data;
+};
+
+struct test_driver_result {
+ /* expected queries */
+ size_t nqueries;
+ size_t cur;
+ unsigned int affected_rows;
+ const char *const *queries;
+
+ /* test result, rows and columns */
+ struct test_driver_result_set *result;
+};
+
+void sql_driver_test_register(void);
+void sql_driver_test_unregister(void);
+
+void sql_driver_test_add_expected_result(struct sql_db *_db,
+ const struct test_driver_result *result);
+void sql_driver_test_clear_expected_results(struct sql_db *_db);
+
+#endif