Add functional and unit tests for DB export/import
All checks were successful
CI Code / Check coding style (pull_request) Successful in 35s
CI Code / Check spelling (pull_request) Successful in 44s
CI Code / Code Coverage (pull_request) Successful in 6m14s
CI Code / Linux (ubuntu) (pull_request) Successful in 7m37s
CI Code / Linux (arch) (pull_request) Successful in 7m41s
CI Code / Linux (debian) (pull_request) Successful in 10m22s
All checks were successful
CI Code / Check coding style (pull_request) Successful in 35s
CI Code / Check spelling (pull_request) Successful in 44s
CI Code / Code Coverage (pull_request) Successful in 6m14s
CI Code / Linux (ubuntu) (pull_request) Successful in 7m37s
CI Code / Linux (arch) (pull_request) Successful in 7m41s
CI Code / Linux (debian) (pull_request) Successful in 10m22s
- 2 functional tests: export_sqlite_to_flatfile, import_flatfile_to_sqlite with XEP-0203 delay timestamps for deterministic verification - 27 unit tests for database_export covering edge cases - Merge test/db-functional-tests: 12 DB persistence tests (test_history) - Group 2 rebalanced: 25 tests (23 base + 2 SQLite-only export/import) - #ifdef HAVE_SQLITE guards for export/import tests - prof_stop() helper in proftest.c - Makefile.am: source ordering cleanup, new test files added
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* Tests are organized into groups for better maintainability and parallel execution:
|
||||
* Group 1: Connect, Ping, Rooms, Software, Last Activity (19 tests)
|
||||
* Group 2: Message, Receipts, Roster, DB History (22 tests)
|
||||
* Group 2: Message, Receipts, Roster, DB History (23+2 tests, +2 with SQLite)
|
||||
* Group 3: Chat Session, Presence, Disconnect (22 tests)
|
||||
* Group 4: MUC, Carbons (21 tests)
|
||||
*
|
||||
@@ -54,6 +54,9 @@
|
||||
#include "test_disconnect.h"
|
||||
#include "test_lastactivity.h"
|
||||
#include "test_history.h"
|
||||
#ifdef HAVE_SQLITE
|
||||
#include "test_export_import.h"
|
||||
#endif
|
||||
|
||||
/* Macro to wrap each test with setup/teardown functions */
|
||||
#define PROF_FUNC_TEST(test) cmocka_unit_test_setup_teardown(test, init_prof_test, close_prof_test)
|
||||
@@ -116,9 +119,15 @@ main(int argc, char* argv[])
|
||||
/* ============================================================
|
||||
* GROUP 2: Message, Receipts, Roster, DB History
|
||||
* Core messaging and contact management
|
||||
* (23 tests)
|
||||
* (25 tests with SQLite, 23 without)
|
||||
* ============================================================ */
|
||||
const struct CMUnitTest group2_tests[] = {
|
||||
#ifdef HAVE_SQLITE
|
||||
/* Export/Import — cross-backend migration (SQLite ↔ flat-file) */
|
||||
PROF_FUNC_TEST(export_sqlite_to_flatfile),
|
||||
PROF_FUNC_TEST(import_flatfile_to_sqlite),
|
||||
#endif
|
||||
|
||||
/* Basic message send/receive */
|
||||
PROF_FUNC_TEST(message_send),
|
||||
PROF_FUNC_TEST(message_receive_console),
|
||||
@@ -147,9 +156,7 @@ main(int argc, char* argv[])
|
||||
PROF_FUNC_TEST(message_db_history_long_message),
|
||||
PROF_FUNC_TEST(message_db_history_newline),
|
||||
PROF_FUNC_TEST(message_db_history_service_chars),
|
||||
#ifdef HAVE_HISTORY_VERIFY
|
||||
PROF_FUNC_TEST(message_db_history_verify),
|
||||
#endif
|
||||
PROF_FUNC_TEST(message_db_history_lmc),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user