megaco_codec_prev3b_test.erl
来自「OTP是开放电信平台的简称」· ERL 代码 · 共 2,256 行 · 第 1/5 页
ERL
2,256 行
compact_otp4920_msg20, compact_otp4920_msg21, compact_otp4920_msg22, compact_otp4920_msg23, compact_otp4920_msg24, compact_otp4920_msg25, compact_otp5186_msg01, compact_otp5186_msg02, compact_otp5186_msg03, compact_otp5186_msg04, compact_otp5186_msg05, compact_otp5186_msg06, compact_otp5793_msg01, compact_otp5836_msg01, compact_otp5993_msg01, compact_otp5993_msg02, compact_otp5993_msg03, compact_otp6017_msg01, compact_otp6017_msg02, compact_otp6017_msg03 ].pretty_tickets(suite) -> [ pretty_otp4632_msg1, pretty_otp4632_msg2, pretty_otp4632_msg3, pretty_otp4632_msg4, pretty_otp4710_msg1, pretty_otp4710_msg2, pretty_otp4945_msg1, pretty_otp4945_msg2, pretty_otp4945_msg3, pretty_otp4945_msg4, pretty_otp4945_msg5, pretty_otp4945_msg6, pretty_otp4949_msg1, pretty_otp4949_msg2, pretty_otp4949_msg3, pretty_otp5042_msg1, pretty_otp5068_msg1, pretty_otp5085_msg1, pretty_otp5085_msg2, pretty_otp5085_msg3, pretty_otp5085_msg4, pretty_otp5085_msg5, pretty_otp5085_msg6, pretty_otp5085_msg7, pretty_otp5085_msg8, pretty_otp5600_msg1, pretty_otp5600_msg2, pretty_otp5601_msg1, pretty_otp5793_msg01, pretty_otp5803_msg01, pretty_otp5803_msg02, pretty_otp5805_msg01, pretty_otp5836_msg01, pretty_otp5882_msg01, pretty_otp6490_msg01, pretty_otp6490_msg02, pretty_otp6490_msg03, pretty_otp6490_msg04, pretty_otp6490_msg05, pretty_otp6490_msg06 ].flex_pretty_tickets(suite) -> {req, [], {conf, flex_pretty_init, flex_pretty_tickets_cases(), flex_pretty_finish}}. flex_pretty_tickets_cases() -> [ flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, flex_pretty_otp5085_msg8, flex_pretty_otp5600_msg1, flex_pretty_otp5600_msg2, flex_pretty_otp5601_msg1, flex_pretty_otp5793_msg01, flex_pretty_otp5803_msg01, flex_pretty_otp5803_msg02, flex_pretty_otp5805_msg01, flex_pretty_otp5836_msg01 ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%pretty_test_msgs(suite) -> [];pretty_test_msgs(Config) when list(Config) -> ?ACQUIRE_NODES(1, Config), Msgs = msgs1(text) ++ msgs2(text) ++ msgs3(text) ++ msgs4(text) ++ msgs5(text) ++ msgs6(text), %% Msgs = msgs1(text), %% Msgs = msgs2(text), %% Msgs = msgs3(text), %% Msgs = msgs4(text), %% Msgs = msgs5(text), %% Msgs = msgs6(text), DynamicDecode = false, test_msgs(megaco_pretty_text_encoder, DynamicDecode, ?EC, Msgs).%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%flex_pretty_init(Config) when list(Config) -> Flag = process_flag(trap_exit, true), Res = (catch start_flex_scanner()), process_flag(trap_exit, Flag), case Res of {error, Reason} -> ?LOG("flex_pretty_init -> error: " "~n Reason: ~p~n", [Reason]), skip(Reason); {Pid, Conf} when pid(Pid) -> [{flex_scanner, Pid, Conf}|Config] end;flex_pretty_init(Config) -> exit({invalid_config, Config}). flex_pretty_finish(Config) when list(Config) -> case lists:keysearch(flex_scanner, 1, Config) of {value, {flex_scanner, Pid, _Conf}} -> stop_flex_scanner(Pid), lists:keydelete(flex_scanner, 1, Config); false -> Config end. flex_pretty_test_msgs(suite) -> [];flex_pretty_test_msgs(Config) when list(Config) -> ?ACQUIRE_NODES(1, Config),%% Msgs = msgs5(text), Msgs = msgs1(text) ++ msgs2(text) ++ msgs3(text) ++ msgs4(text) ++ msgs5(text) ++ msgs6(text), Conf = flex_scanner_conf(Config), DynamicDecode = false, test_msgs(megaco_pretty_text_encoder, DynamicDecode, [?EC_V3,Conf], Msgs).flex_pretty_otp5042_msg1(suite) -> [];flex_pretty_otp5042_msg1(Config) when list(Config) -> d("flex_pretty_otp5042_msg1 -> entry", []), ?ACQUIRE_NODES(1, Config), Msg0 = pretty_otp5042_msg1(), Bin0 = list_to_binary(Msg0), case pretty_decode_message(false, ?EC, Bin0) of {error, [{reason, Reason}|_]} -> case Reason of {_, _Mod, {bad_timeStamp, TimeStamp}} -> exit({bad_timeStamp, TimeStamp}); _ -> io:format("flex_pretty_otp5042_msg1 -> " "~n Reason: ~w" "~n", [Reason]), exit({unexpected_decode_result, Reason}) end; {ok, M} -> t("flex_pretty_otp5042_msg1 -> successfull decode:" "~n~p", [M]), ok end.flex_pretty_otp5085_msg1(suite) -> [];flex_pretty_otp5085_msg1(Config) when list(Config) -> d("flex_pretty_otp5085_msg1 -> entry", []), ?ACQUIRE_NODES(1, Config), Conf = flex_scanner_conf(Config), pretty_otp5085(ok, pretty_otp5085_msg1(), [Conf]).flex_pretty_otp5085_msg2(suite) -> [];flex_pretty_otp5085_msg2(Config) when list(Config) -> d("flex_pretty_otp5085_msg2 -> entry", []), ?ACQUIRE_NODES(1, Config), Conf = flex_scanner_conf(Config), pretty_otp5085(error, pretty_otp5085_msg2(), [Conf]).flex_pretty_otp5085_msg3(suite) -> [];flex_pretty_otp5085_msg3(Config) when list(Config) -> d("flex_pretty_otp5085_msg3 -> entry", []), ?ACQUIRE_NODES(1, Config), Conf = flex_scanner_conf(Config), pretty_otp5085(ok, pretty_otp5085_msg3(), [Conf]).flex_pretty_otp5085_msg4(suite) -> [];flex_pretty_otp5085_msg4(Config) when list(Config) -> d("flex_pretty_otp5085_msg4 -> entry", []), ?ACQUIRE_NODES(1, Config), Conf = flex_scanner_conf(Config), pretty_otp5085(ok, pretty_otp5085_msg4(), [Conf]).flex_pretty_otp5085_msg5(suite) -> [];flex_pretty_otp5085_msg5(Config) when list(Config) -> d("flex_pretty_otp5085_msg5 -> entry", []), ?ACQUIRE_NODES(1, Config), Conf = flex_scanner_conf(Config), pretty_otp5085(ok, pretty_otp5085_msg5(), [Conf]).flex_pretty_otp5085_msg6(suite) -> [];flex_pretty_otp5085_msg6(Config) when list(Config) -> d("flex_pretty_otp5085_msg6 -> entry", []), ?ACQUIRE_NODES(1, Config), Conf = flex_scanner_conf(Config), pretty_otp5085(ok, pretty_otp5085_msg6(), [Conf]).flex_pretty_otp5085_msg7(suite) -> [];flex_pretty_otp5085_msg7(Config) when list(Config) -> d("flex_pretty_otp5085_msg7 -> entry", []), ?ACQUIRE_NODES(1, Config), Conf = flex_scanner_conf(Config), pretty_otp5085(ok, pretty_otp5085_msg7(), [Conf]).flex_pretty_otp5085_msg8(suite) -> [];flex_pretty_otp5085_msg8(Config) when list(Config) -> d("flex_pretty_otp5085_msg8 -> entry", []), ?ACQUIRE_NODES(1, Config), Conf = flex_scanner_conf(Config), pretty_otp5085(ok, pretty_otp5085_msg8(), [Conf]).flex_pretty_otp5600_msg1(suite) -> [];flex_pretty_otp5600_msg1(Config) when list(Config) -> d("flex_pretty_otp5600_msg1 -> entry", []), ?ACQUIRE_NODES(1, Config), Conf = flex_scanner_conf(Config), pretty_otp5600(ok, pretty_otp5600_msg1(), [Conf]). flex_pretty_otp5600_msg2(suite) -> [];flex_pretty_otp5600_msg2(Config) when list(Config) -> d("flex_pretty_otp5600_msg2 -> entry", []), ?ACQUIRE_NODES(1, Config), Conf = flex_scanner_conf(Config), pretty_otp5600(ok, pretty_otp5600_msg2(), [Conf]). flex_pretty_otp5601_msg1(suite) -> [];flex_pretty_otp5601_msg1(Config) when list(Config) -> d("flex_pretty_otp5601_msg1 -> entry", []), ?ACQUIRE_NODES(1, Config), Conf = flex_scanner_conf(Config), pretty_otp5601(ok, pretty_otp5601_msg1(), [Conf]).flex_pretty_otp5793_msg01(suite) -> [];flex_pretty_otp5793_msg01(Config) when list(Config) -> d("flex_pretty_otp5793_msg01 -> entry", []), ?ACQUIRE_NODES(1, Config), Conf = flex_scanner_conf(Config), pretty_otp5793(ok, pretty_otp5793_msg1(), [Conf]).flex_pretty_otp5803_msg01(suite) -> [];flex_pretty_otp5803_msg01(Config) when list(Config) -> d("flex_pretty_otp5803_msg01 -> entry", []), ?ACQUIRE_NODES(1, Config),%% put(severity,trc),%% put(dbg,true), Conf = flex_scanner_conf(Config), pretty_otp5803(pretty_otp5803_msg1(), [Conf]).flex_pretty_otp5803_msg02(suite) -> [];flex_pretty_otp5803_msg02(Config) when list(Config) -> d("flex_pretty_otp5803_msg02 -> entry", []), ?ACQUIRE_NODES(1, Config),%% put(severity,trc),%% put(dbg,true), Conf = flex_scanner_conf(Config), pretty_otp5803(pretty_otp5803_msg2(), [Conf]).flex_pretty_otp5805_msg01(suite) -> [];flex_pretty_otp5805_msg01(Config) when list(Config) -> d("flex_pretty_otp5805_msg01 -> entry", []), ?ACQUIRE_NODES(1, Config),%% put(severity,trc),%% put(dbg,true), Conf = flex_scanner_conf(Config), pretty_otp5805(pretty_otp5805_msg1(), [Conf]).flex_pretty_otp5836_msg01(suite) -> [];flex_pretty_otp5836_msg01(Config) when list(Config) -> d("flex_pretty_otp5836_msg01 -> entry", []), ?ACQUIRE_NODES(1, Config),%% put(severity,trc),%% put(dbg,true), Conf = flex_scanner_conf(Config), pretty_otp5836(compact_otp5836_msg1(), [Conf]).%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%compact_test_msgs(suite) -> [];compact_test_msgs(Config) when list(Config) -> ?ACQUIRE_NODES(1, Config), Msgs = msgs1(text) ++ msgs2(text) ++ msgs3(text) ++ msgs4(text) ++ msgs5(text) ++ msgs6(text), %% Msgs = msgs6(text), DynamicDecode = false, test_msgs(megaco_compact_text_encoder, DynamicDecode, ?EC, Msgs).%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%flex_compact_init(Config) when list(Config) -> Flag = process_flag(trap_exit, true), Res = (catch start_flex_scanner()), process_flag(trap_exit, Flag), case Res of {error, Reason} -> ?LOG("flex_compact_init -> error: " "~n Reason: ~p~n", [Reason]), skip(Reason); {Pid, Conf} when pid(Pid) -> [{flex_scanner, Pid, Conf}|Config] end. flex_compact_finish(Config) when list(Config) -> case lists:keysearch(flex_scanner, 1, Config) of {value, {flex_scanner, Pid, _Conf}} -> stop_flex_scanner(Pid), lists:keydelete(flex_scanner, 1, Config); false -> Config end. flex_compact_test_msgs(suite) -> [];flex_compact_test_msgs(Config) when list(Config) -> ?ACQUIRE_NODES(1, Config), Msgs = msgs1(text) ++ msgs2(text) ++ msgs3(text) ++ msgs4(text) ++ msgs5(text) ++ msgs6(text), Conf = flex_scanner_conf(Config), DynamicDecode = true, test_msgs(megaco_compact_text_encoder, DynamicDecode, [?EC_V3,Conf], Msgs).flex_compact_dm_timers1(suite) -> [];flex_compact_dm_timers1(Config) when list(Config) -> ?ACQUIRE_NODES(1, Config), M = build_dm_timers_message("1", "2", "3"), B = list_to_binary(M), Conf = flex_scanner_conf(Config), case decode_message(megaco_compact_text_encoder, false, [?EC_V3,Conf], B) of {ok, M1} when record(M1,'MegacoMessage') -> t("flex_compact_dm_timers1 -> " "~n M: ~s" "~n M1: ~p", [M, M1]), verify_dm_timers({1,2,3}, M1); Else -> exit({decode_failed, M, Else}) end.flex_compact_dm_timers2(suite) -> [];flex_compact_dm_timers2(Config) when list(Config) -> ?ACQUIRE_NODES(1, Config), M = build_dm_timers_message("02", "03", "04"), B = list_to_binary(M), Conf = flex_scanner_conf(Config), case decode_message(megaco_compact_text_encoder, false, [?EC_V3,Conf], B) of {ok, M1} when record(M1,'MegacoMessage') -> t("flex_compact_dm_timers2 -> " "~n M: ~s" "~n M1: ~p", [M, M1]), verify_dm_timers({2,3,4}, M1); Else -> exit({decode_failed, M, Else}) end.flex_compact_dm_timers3(suite) -> [];flex_compact_dm_timers3(Config) when list(Config) -> ?ACQUIRE_NODES(1, Config), M = build_dm_timers_message("1", "02", "31"), B = list_to_binary(M), Conf = flex_scanner_conf(Config), case decode_message(megaco_compact_text_encoder, false, [?EC_V3,Conf], B) of {ok, M1} when record(M1,'MegacoMessage') -> t("flex_compact_dm_timers3 -> " "~n M: ~s" "~n M1: ~p", [M, M1]), verify_dm_timers({1,2,31}, M1); Else -> exit({decode_failed, M, Else}) end.flex_compact_dm_timers4(suite) -> [];flex_compact_dm_timers4(Config) when list(Config) -> ?ACQUIRE_NODES(1, Config), M = build_dm_timers_message("10", "21", "99"), B = list_to_binary(M), Conf = flex_scanner_conf(Config), case decode_message(megaco_compact_text_encoder, false, [?EC_V3,Conf], B) of {ok, M1} when record(M1,'MegacoMessage') -> t("flex_compact_dm_timers4 -> " "~n M: ~s" "~n M1: ~p", [M, M1]), verify_dm_timers({10,21,99}, M1); Else -> exit({decode_failed, M, Else}) end.flex_compact_dm_timers5(suite) -> [];flex_compact_dm_timers5(Config) when list(Config) -> ?ACQUIRE_NODES(1, Config), M = build_dm_timers_message("99", "23", "11"), B = list_to_binary(M), Conf = flex_scanner_conf(Config), case decode_message(megaco_compact_text_encoder, false, [?EC_V3,Conf], B) of {ok, M1} when record(M1,'MegacoMessage') ->
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?