mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-22 20:36:22 +00:00
test: add database stress tests (14 tests, rapid writes, large messages, LMC chains, dedup)
This commit is contained in:
1131
tests/unittests/test_database_stress.c
Normal file
1131
tests/unittests/test_database_stress.c
Normal file
File diff suppressed because it is too large
Load Diff
28
tests/unittests/test_database_stress.h
Normal file
28
tests/unittests/test_database_stress.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/* test_database_stress.h — stress tests for database I/O, MUC, large messages,
|
||||
* export/import roundtrip under load, and index/cache correctness. */
|
||||
|
||||
/* High-throughput write + parse */
|
||||
void test_stress_rapid_write_parse_1000(void** state);
|
||||
void test_stress_rapid_write_parse_10000(void** state);
|
||||
|
||||
/* MUC (chat room) messages */
|
||||
void test_stress_muc_many_participants(void** state);
|
||||
void test_stress_muc_rapid_messages(void** state);
|
||||
|
||||
/* Large messages */
|
||||
void test_stress_large_message_1mb(void** state);
|
||||
void test_stress_large_message_body_with_special_chars(void** state);
|
||||
void test_stress_many_large_messages_100(void** state);
|
||||
|
||||
/* Index and ID cache correctness under load */
|
||||
void test_stress_index_build_10000_lines(void** state);
|
||||
void test_stress_index_extend_append(void** state);
|
||||
void test_stress_id_cache_dedup_correctness(void** state);
|
||||
|
||||
/* Export / import roundtrip under load */
|
||||
void test_stress_export_merge_dedup_1000(void** state);
|
||||
void test_stress_mixed_types_and_encodings(void** state);
|
||||
|
||||
/* LMC correction chains under load */
|
||||
void test_stress_lmc_chain_deep(void** state);
|
||||
void test_stress_lmc_many_corrections(void** state);
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "test_callbacks.h"
|
||||
#include "test_plugins_disco.h"
|
||||
#include "test_database_export.h"
|
||||
#include "test_database_stress.h"
|
||||
|
||||
#define muc_unit_test(f) cmocka_unit_test_setup_teardown(f, muc_before_test, muc_after_test)
|
||||
|
||||
@@ -709,6 +710,22 @@ main(int argc, char* argv[])
|
||||
cmocka_unit_test(test_ff_parsed_line_free_null_safe),
|
||||
cmocka_unit_test(test_ff_parse_line_no_space_rejected),
|
||||
cmocka_unit_test(test_ff_parse_line_unclosed_bracket),
|
||||
|
||||
// Stress tests
|
||||
cmocka_unit_test(test_stress_rapid_write_parse_1000),
|
||||
cmocka_unit_test(test_stress_rapid_write_parse_10000),
|
||||
cmocka_unit_test(test_stress_muc_many_participants),
|
||||
cmocka_unit_test(test_stress_muc_rapid_messages),
|
||||
cmocka_unit_test(test_stress_large_message_1mb),
|
||||
cmocka_unit_test(test_stress_large_message_body_with_special_chars),
|
||||
cmocka_unit_test(test_stress_many_large_messages_100),
|
||||
cmocka_unit_test(test_stress_index_build_10000_lines),
|
||||
cmocka_unit_test(test_stress_index_extend_append),
|
||||
cmocka_unit_test(test_stress_id_cache_dedup_correctness),
|
||||
cmocka_unit_test(test_stress_export_merge_dedup_1000),
|
||||
cmocka_unit_test(test_stress_mixed_types_and_encodings),
|
||||
cmocka_unit_test(test_stress_lmc_chain_deep),
|
||||
cmocka_unit_test(test_stress_lmc_many_corrections),
|
||||
};
|
||||
return cmocka_run_group_tests(all_tests, NULL, NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user