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

- 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:
2026-03-02 15:45:27 +03:00
parent f88299047e
commit 081de77593
11 changed files with 671 additions and 8 deletions

View File

@@ -396,6 +396,24 @@ close_prof_test(void **state)
return 0;
}
void
prof_stop(void)
{
if (fd > 0 && child_pid > 0) {
prof_input("/quit");
sleep(1);
waitpid(child_pid, NULL, 0);
close(fd);
fd = 0;
child_pid = 0;
}
/* Reset output buffer for clean restart */
output_len = 0;
output_buffer[0] = '\0';
/* Brief delay to let stabber release old connection state */
usleep(200000); /* 200ms */
}
void
prof_input(const char *input)
{