diff options
| author | 李佳 <[email protected]> | 2024-04-12 11:41:14 +0000 |
|---|---|---|
| committer | 李佳 <[email protected]> | 2024-04-12 11:41:14 +0000 |
| commit | f40db506ee7570e836ac97b7806a679bc36da155 (patch) | |
| tree | e4483ca1d2a28079c57ab6f0ac055dfe08c47915 /test/http_decoder_gtest.h | |
| parent | 55ac6e270ae37299e2bce3a47a3d784e29dcae14 (diff) | |
| parent | 094d0f8e45931b195e358989d2843a298e9fd567 (diff) | |
Merge branch 'api-unit-test' into 'develop'
Add unit tests.
See merge request stellar/http_decoder!5
Diffstat (limited to 'test/http_decoder_gtest.h')
| -rw-r--r-- | test/http_decoder_gtest.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/http_decoder_gtest.h b/test/http_decoder_gtest.h index b58def3..8e83a70 100644 --- a/test/http_decoder_gtest.h +++ b/test/http_decoder_gtest.h @@ -110,3 +110,19 @@ struct fake_session char *readable_addr_cstr; void *plug_exdata_array[EX_DATA_MAX_SIZE]; }; + +typedef void *(*HTTP_DECODER_INIT_FUN_T)(struct stellar *st); +typedef int (*HTTP_DECODER_ENTRY_FUN_T)(struct session *sess, int events, const struct packet *pkt, void *cb_arg); +typedef int (*HTTP_DECODER_PLUG_ENTRY_FUN_T)(struct session *sess, int topic_id, const void *data, void *cb_arg); +extern struct fake_stellar *hdgt_create(void); +extern int hdgt_init_once(struct fake_stellar *fst, int argc, char **argv, + HTTP_DECODER_INIT_FUN_T hd_init_fun, HTTP_DECODER_ENTRY_FUN_T hd_entry_fun, + HTTP_DECODER_INIT_FUN_T hd_plug_init_fun, HTTP_DECODER_PLUG_ENTRY_FUN_T hd_plug_entry_fun); +extern int hdgt_data_source_init_by_json_text(struct fake_stellar *fst, const char *json_cont); +int hdgt_under_test_module_init(struct fake_stellar *fst, HTTP_DECODER_INIT_FUN_T init_fun, HTTP_DECODER_ENTRY_FUN_T entry_fun); +int hdgt_test_plug_init(struct fake_stellar *fst, HTTP_DECODER_INIT_FUN_T init_fun, HTTP_DECODER_PLUG_ENTRY_FUN_T entry_fun); +extern void hdgt_main_loop(struct fake_stellar *fst); +extern void hdgt_destroy(struct fake_stellar *fst); +extern int hdgt_compare_result(struct fake_stellar *fst); +extern void hdgt_set_data_source_type(fake_stellar *fst, enum data_source_type_t type); +extern "C" void http_decoder_plug_set_entry_fuc(HTTP_DECODER_PLUG_ENTRY_FUN_T entry_fun);
\ No newline at end of file |
