Asterisk - The Open Source Telephony Project  18.5.0
Data Structures | Macros | Enumerations
test.h File Reference

Test Framework API. More...

#include "asterisk/cli.h"
#include "asterisk/strings.h"
Include dependency graph for test.h:

Go to the source code of this file.

Data Structures

struct  ast_test_info
 Contains all the initialization information required to store a new test definition. More...
 

Macros

#define ast_test_debug(test, fmt, ...)   ast_cli /* Dummy function that should not be called. */
 
#define AST_TEST_DEFINE(hdr)   static enum ast_test_result_state attribute_unused hdr(struct ast_test_info *info, enum ast_test_command cmd, struct ast_test *test)
 
#define AST_TEST_REGISTER(cb)
 
#define ast_test_status_update(a, b, c...)
 
#define ast_test_suite_event_notify(s, f, ...)
 
#define AST_TEST_UNREGISTER(cb)
 

Enumerations

enum  ast_test_command { TEST_INIT, TEST_EXECUTE }
 
enum  ast_test_result_state { AST_TEST_NOT_RUN, AST_TEST_PASS, AST_TEST_FAIL }
 

Detailed Description

Test Framework API.

For an overview on how to use the test API, see Asterisk Unit Test API

Author
David Vossel dvoss.nosp@m.el@d.nosp@m.igium.nosp@m..com
Russell Bryant russe.nosp@m.ll@d.nosp@m.igium.nosp@m..com

Definition in file test.h.

Macro Definition Documentation

◆ ast_test_debug

#define ast_test_debug (   test,
  fmt,
  ... 
)    ast_cli /* Dummy function that should not be called. */

Definition at line 130 of file test.h.

◆ AST_TEST_DEFINE

#define AST_TEST_DEFINE (   hdr)    static enum ast_test_result_state attribute_unused hdr(struct ast_test_info *info, enum ast_test_command cmd, struct ast_test *test)

Macros used for defining and registering a test

Definition at line 126 of file test.h.

◆ AST_TEST_REGISTER

#define AST_TEST_REGISTER (   cb)

◆ ast_test_status_update

#define ast_test_status_update (   a,
  b,
  c... 
)

Definition at line 129 of file test.h.

Referenced by add_notify(), AST_TEST_DEFINE(), astobj2_test_1_helper(), build_conf(), build_ha(), check_cache_content(), check_event(), check_events(), check_node(), check_retrieve_call_extensions(), check_stats(), check_stream_positions(), create_resource_list(), dump_consumer(), dump_event(), events_are_equal(), generate_test_parking_lot(), handler_wait_for_message(), insert_test_duplicates(), insert_test_vector(), invalid_record_test(), is_timed_out(), json_test_cleanup(), listener_check(), mock_tcp_loop(), nominal_async_run(), nominal_sync_run(), nominal_test(), off_nominal_async_run(), off_nominal_sync_run(), off_nominal_test(), parked_users_match(), parking_lot_cfgs_match(), query_set_test(), read_test(), sched_order_check(), scheduler(), send_msg(), test_2way_function(), test_ao2_callback_traversal(), test_ao2_find_w_no_flags(), test_ao2_find_w_OBJ_KEY(), test_ao2_find_w_OBJ_PARTIAL_KEY(), test_ao2_find_w_OBJ_POINTER(), test_ao2_iteration(), test_chan_function(), test_chan_integer(), test_chan_integer_accessor(), test_chan_string(), test_chan_variable(), test_container_clone(), test_create_joint(), test_dtmf_amplitude_sweep(), test_dtmf_twist_sweep(), test_expected_duplicates(), test_expected_result(), test_exten(), test_files_create(), test_files_destroy(), test_jb_late_frame_insertion(), test_jb_lost_frame_insertion(), test_jb_nominal_frame_insertion(), test_jb_out_of_order_frame_insertion(), test_lock(), test_performance(), test_record(), test_ref(), test_results(), test_tone_amplitude_sweep(), test_tone_freq_sweep(), test_traversal_nonsorted(), test_traversal_sorted(), test_unlock(), test_unref(), test_xml(), testloop(), user_event_wait_for_events(), validate_original_streams(), validate_stream(), verify_bad_headers(), verify_mock_cdr_record(), wait_for_channel_callback(), wait_for_completion(), wait_for_device_state_updates(), wait_for_empty_notice(), wait_for_hook(), wait_for_resolution(), wait_until_thread_state(), and wait_until_thread_state_task_pushed().

◆ ast_test_suite_event_notify

#define ast_test_suite_event_notify (   s,
  f,
  ... 
)

Macros used for the Asterisk Test Suite AMI events

Examples:
/usr/src/asterisk-18.5.0/main/app.c.

Definition at line 196 of file test.h.

Referenced by advanced_options(), ast_bridge_channel_feature_digit(), ast_channel_callid_set(), ast_check_hangup(), ast_load_resource(), ast_rtp_ice_start(), ast_rtp_read(), ast_sip_subscription_notify(), ast_streamfile(), ast_unload_resource(), ast_waitfor_nandfds(), bridge_features_duration_callback(), bridge_handle_dtmf(), chan_pjsip_indicate(), change_password_realtime(), conf_change_state(), conf_exec(), conf_play(), conf_run(), conf_start_record(), conf_stop_record(), conf_update_user_mute(), control_streamfile(), dialout(), execute_menu_entry(), forward_message(), generic_lock_unlock_helper(), generic_mute_unmute_user(), get_folder(), get_folder2(), grab_transfer(), indicate_data_internal(), initial_notify_task(), messaging_app_subscribe_endpoint(), messaging_app_unsubscribe_endpoint(), mixmonitor_thread(), msg_send(), play_message(), pubsub_on_refresh_timeout(), pubsub_on_rx_mwi_notify_request(), register_aor_core(), registrar_contact_delete(), rtp_allocate_transport(), say_number_full(), serialized_send_notify(), session_destructor(), session_inv_on_tsx_state_changed(), sip_options_contact_status_notify_task(), sip_options_set_contact_status(), sip_subscription_send_request(), stale_item_update(), state_notify_build_xml(), testsuite_notify_feature_success(), verify(), vm_change_password(), vm_change_password_shell(), vm_execmain(), vm_forwardoptions(), vm_newuser_setup(), vm_options(), vm_tempgreeting(), wait_file(), waitstream_control(), and waitstream_core().

◆ AST_TEST_UNREGISTER

#define AST_TEST_UNREGISTER (   cb)

Enumeration Type Documentation

◆ ast_test_command

Enumerator
TEST_INIT 
TEST_EXECUTE 

Definition at line 206 of file test.h.

206  {
207  TEST_INIT,
208  TEST_EXECUTE,
209 };

◆ ast_test_result_state

Enumerator
AST_TEST_NOT_RUN 
AST_TEST_PASS 
AST_TEST_FAIL 

Definition at line 200 of file test.h.

200  {
204 };