Files
cproof/tests/unittests/test_database_export.h
jabber.developer2 081de77593
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
Add functional and unit tests for DB export/import
- 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
2026-03-04 18:45:17 +03:00

40 lines
1.7 KiB
C

/* test_database_export.h — unit tests for flatfile write/parse round-trip,
* escape/unescape, and jid_to_dir helpers used by export/import. */
/* write → parse round-trip */
void test_ff_roundtrip_simple_chat(void** state);
void test_ff_roundtrip_with_all_metadata(void** state);
void test_ff_roundtrip_with_resource(void** state);
void test_ff_roundtrip_newline_in_body(void** state);
void test_ff_roundtrip_pipe_in_stanza_id(void** state);
void test_ff_roundtrip_backslash_in_body(void** state);
void test_ff_roundtrip_unicode_body(void** state);
void test_ff_roundtrip_empty_body(void** state);
void test_ff_roundtrip_colonspace_in_resource(void** state);
void test_ff_roundtrip_muc_type(void** state);
void test_ff_roundtrip_omemo_enc(void** state);
void test_ff_roundtrip_replace_id(void** state);
/* escape / unescape symmetry */
void test_ff_escape_unescape_message_identity(void** state);
void test_ff_escape_unescape_meta_identity(void** state);
void test_ff_escape_meta_null_returns_null(void** state);
void test_ff_escape_message_null_returns_empty(void** state);
/* jid_to_dir */
void test_ff_jid_to_dir_simple(void** state);
void test_ff_jid_to_dir_with_at(void** state);
void test_ff_jid_to_dir_path_traversal_rejected(void** state);
void test_ff_jid_to_dir_null(void** state);
/* parser edge cases */
void test_ff_parse_line_empty(void** state);
void test_ff_parse_line_comment(void** state);
void test_ff_parse_line_legacy_format(void** state);
void test_ff_parse_line_no_metadata(void** state);
void test_ff_parse_line_invalid_timestamp(void** state);
/* type/enc conversion round-trip */
void test_ff_type_str_roundtrip(void** state);
void test_ff_enc_str_roundtrip(void** state);