Ver código fonte

ft: 测试代码添加

master
SisMaker 3 anos atrás
pai
commit
092ee3be1e
3 arquivos alterados com 27 adições e 9 exclusões
  1. +7
    -6
      src/measure/utTc.erl
  2. +7
    -3
      src/testCase/utTestBinAddr.erl
  3. +13
    -0
      src/testCase/utTestBinAddr2.erl

+ 7
- 6
src/measure/utTc.erl Ver arquivo

@ -148,12 +148,13 @@ tm(ProcCnt, LoopTime, M, F, A) ->
io:format("execute Mod :~p~n", [M]),
io:format("execute LoopTime:~p~n", [LoopTime]),
io:format("execute ProcCnts:~p~n", [ProcCnt]),
io:format("MaxTime: ~10s(ns) ~10s(s)~n", [integer_to_binary(Max), float_to_binary(Max / 1000000000, [{decimals, 6}, compact])]),
io:format("MinTime: ~10s(ns) ~10s(s)~n", [integer_to_binary(Min), float_to_binary(Min / 1000000000, [{decimals, 6}, compact])]),
io:format("SumTime: ~10s(ns) ~10s(s)~n", [integer_to_binary(Sum), float_to_binary(Sum / 1000000000, [{decimals, 6}, compact])]),
io:format("AvgTime: ~10s(ns) ~10s(s)~n", [float_to_binary(Aver, [{decimals, 6}, compact]), float_to_binary(Aver / 1000000000, [{decimals, 6}, compact])]),
io:format("Grar : ~10s(cn) ~10s(~s)~n", [integer_to_binary(Greater), float_to_binary(Greater / LoopTime, [{decimals, 2}]), <<"%">>]),
io:format("Less : ~10s(cn) ~10s(~s)~n", [integer_to_binary(Less), float_to_binary(Less / LoopTime, [{decimals, 2}]), <<"%">>]),
io:format("PMaxTime: ~10s(ns) ~10s(s)~n", [integer_to_binary(Max), float_to_binary(Max / 1000000000, [{decimals, 6}, compact])]),
io:format("PMinTime: ~10s(ns) ~10s(s)~n", [integer_to_binary(Min), float_to_binary(Min / 1000000000, [{decimals, 6}, compact])]),
io:format("PSumTime: ~10s(ns) ~10s(s)~n", [integer_to_binary(Sum), float_to_binary(Sum / 1000000000, [{decimals, 6}, compact])]),
io:format("PAvgTime: ~10s(ns) ~10s(s)~n", [float_to_binary(Aver, [{decimals, 6}, compact]), float_to_binary(Aver / 1000000000, [{decimals, 6}, compact])]),
io:format("FAvgTime: ~10s(ns) ~10s(s)~n", [float_to_binary(Aver, [{decimals, 6}, compact]), float_to_binary(Aver / LoopTime / 1000000000, [{decimals, 6}, compact])]),
io:format("PGrar : ~10s(cn) ~10s(~s)~n", [integer_to_binary(Greater), float_to_binary(Greater / ProcCnt, [{decimals, 2}]), <<"%">>]),
io:format("PLess : ~10s(cn) ~10s(~s)~n", [integer_to_binary(Less), float_to_binary(Less / ProcCnt, [{decimals, 2}]), <<"%">>]),
io:format("=====================~n").

+ 7
- 3
src/testCase/utTestBinAddr.erl Ver arquivo

@ -15,15 +15,19 @@ getBin22() ->
<<"fdsafsdfsdfdsfasfdsffffffffffffffffffffffffffffffffffffffffffffffffffffHJlhdsjflshdalfkhsaklfhsdafjkdshfkla范德萨发送发送"/utf8>>.
test() ->
A = <<"fdsafsdf范德萨发送发送"/utf8>>,
A1 = <<"fdsafsdf范德萨发送发送"/utf8>>,
A2 = <<"fdsafsdf范德萨发送发送"/utf8>>,
B = <<"fdsafsdfsdfdsfasfdsffffffffffffffffffffffffffffffffffffffffffffffffffffHJlhdsjflshdalfkhsaklfhsdafjkdshfkla范德萨发送发送"/utf8>>,
io:format("IMY************************~n~p\n~p\n~p\n~p~n~p\n~p\n",
io:format("IMY************************~n~p\n~p\n~p\n~p\n~p\n~p~n~p\n~p\n ddd ~p\n",
[
binaryAddr:getBinAddr(getBin11()),
binaryAddr:getBinAddr(getBin12()),
binaryAddr:getBinAddr(utTestBinAddr2:getBin11()),
binaryAddr:getBinAddr(utTestBinAddr2:getBin12()),
binaryAddr:getBinAddr(getBin21()),
binaryAddr:getBinAddr(getBin22()),
binaryAddr:getBinAddr(A),
binaryAddr:getBinAddr(A1),
binaryAddr:getBinAddr(A2),
binaryAddr:getBinAddr(B)
]).

+ 13
- 0
src/testCase/utTestBinAddr2.erl Ver arquivo

@ -0,0 +1,13 @@
-module(utTestBinAddr2).
-compile([export_all, nowarn_unused_function, nowarn_unused_vars, nowarn_export_all]).
getBin11() ->
<<"fdsafsdf范德萨发送发送"/utf8>>.
getBin12() ->
<<"fdsafsdf范德萨发送发送"/utf8>>.

Carregando…
Cancelar
Salvar