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
This commit is contained in:
39
tests/unittests/test_database_export.h
Normal file
39
tests/unittests/test_database_export.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/* 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);
|
||||
Reference in New Issue
Block a user