Procházet zdrojové kódy

测试新增

master
AICells před 4 roky
rodič
revize
734a0755cf
1 změnil soubory, kde provedl 87 přidání a 87 odebrání
  1. +87
    -87
      src/testCase/utSelectVal.erl

+ 87
- 87
src/testCase/utSelectVal.erl Zobrazit soubor

@ -27,81 +27,81 @@ makeStr2(0, BinStr) ->
makeStr2(N, BinStr) ->
PN = rand:uniform(8),
VStr = << <<"V", (integer_to_binary(VN))/binary, ", ">> || VN <- lists:seq(1, PN)>>,
Str = <<"hand(test", (integer_to_binary(N))/binary, ", {test", (integer_to_binary(N))/binary, ", ", VStr/binary,"V100}) ->\n\t", (integer_to_binary(N))/binary, ";\n">>,
Str = <<"hand(test", (integer_to_binary(N))/binary, ", {test", (integer_to_binary(N))/binary, ", ", VStr/binary, "V100}) ->\n\t", (integer_to_binary(N))/binary, ";\n">>,
makeStr2(N - 1, <<BinStr/binary, Str/binary>>).
%% call1(N, Y) ->
%% KVList = [{{value, test, Index, Index}, {value, test, Index, Index+2}} || Index <- lists:seq(1, Y)],
%% utKvsToBeam:load(ttttt, KVList),
%% io:format("IMY********load ok~n"),
%% T = erlang:system_time(microsecond),
%% A = ?MODULE,
%% Fun = get,
%% call1(N, Y, T, A, Fun, 0).
%%
%% call1(0, A1, A2, _A, _Fun, _V) ->
%% Key = rand:uniform(A1),
%% V = ttttt:get({value, test, Key, Key}),
%% {erlang:system_time(microsecond) - A2, V};
%% call1(N, A1, A2, A, Fun, _V) ->
%% Key = rand:uniform(A1),
%% V = ttttt:get({value, test, Key, Key}),
%% call1(N - 1, A1, A2, A, Fun, V).
%%
%% get1({value, test, 1500, 1500}) ->
%% {value, test, 1500, 1500}.
%%
%% call2(N, Y) ->
%% A = utFunCallCase,
%% Fun = get1,
%% T = erlang:system_time(microsecond),
%% call2(N, Y, T, A, Fun, 0).
%%
%% call2(0, _A1, A2, A, Fun, _V) ->
%% V = ?MODULE:Fun({value, test, 1500, 1500}),
%% {erlang:system_time(microsecond) - A2, V};
%% call2(N, A1, A2, A, Fun, _Key) ->
%% Key = rand:uniform(A1),
%% _V = ?MODULE:Fun({value, test, 1500, 1500}),
%% call2(N - 1, A1, A2, A, Fun, Key).
%%
%% call3(N, Y) ->
%% A = ?MODULE,
%% Fun = get1,
%% T = erlang:system_time(microsecond),
%% call3(N, Y, T, A, Fun, 0).
%%
%% call3(0, _A1, A2, A, Fun, _K) ->
%% _V = erlang:apply(A, Fun, [{value, test, 1500, 1500}]),
%% {erlang:system_time(microsecond) - A2, _K};
%% call3(N, A1, A2, A, Fun, _key) ->
%% Key = rand:uniform(A1),
%% _V = erlang:apply(A, Fun, [{value, test, 1500, 1500}]),
%% call3(N - 1, A1, A2, A, Fun, Key).
%%
%% call4(N, Y) ->
%% A = ?MODULE,
%% Fun = get1,
%% T = erlang:system_time(microsecond),
%% call4(N, Y, T, A, Fun, 0).
%%
%% call4(0, _A1, A2, A, Fun, _K) ->
%% erlang:apply(A, Fun, [{value, test, 1500, 1500}]),
%% {erlang:system_time(microsecond) - A2, _K};
%% call4(N, A1, A2, A, Fun, _key) ->
%% Key = rand:uniform(A1),
%% Args = [{value, test, 1500, 1500}],
%% erlang:apply(A, Fun, Args),
%% call4(N - 1, A1, A2, A, Fun, Key).
%%
%% -define(AcList, [{eTimeout, 11, 22}, {u_eTimeout, 22}, {sTimeout, 111, 222, 333}, c_eTimeout, c_sTimeout, {nextEvent, 222, fdfd}, {doAfter, args}]).
call1(N, Y) ->
KVList = [{{value, test, Index, Index}, {value, test, Index, Index + 2}} || Index <- lists:seq(1, Y)],
utKvsToBeam:load(ttttt, KVList),
io:format("IMY********load ok~n"),
T = erlang:system_time(microsecond),
A = ?MODULE,
Fun = get,
call1(N, Y, T, A, Fun, 0).
% ht11(0, _Fun) ->
% ok;
% ht11(N, Fun) ->
% ?MODULE:Fun(?AcList, 1, ttt, [], true, fasle, false, [], []),
% ht11(N - 1, Fun).
call1(0, A1, A2, _A, _Fun, _V) ->
Key = rand:uniform(A1),
V = ttttt:get({value, test, Key, Key}),
{erlang:system_time(microsecond) - A2, V};
call1(N, A1, A2, A, Fun, _V) ->
Key = rand:uniform(A1),
V = ttttt:get({value, test, Key, Key}),
call1(N - 1, A1, A2, A, Fun, V).
get1({value, test, 1500, 1500}) ->
{value, test, 1500, 1500}.
call2(N, Y) ->
A = utFunCallCase,
Fun = get1,
T = erlang:system_time(microsecond),
call2(N, Y, T, A, Fun, 0).
call2(0, _A1, A2, A, Fun, _V) ->
V = ?MODULE:Fun({value, test, 1500, 1500}),
{erlang:system_time(microsecond) - A2, V};
call2(N, A1, A2, A, Fun, _Key) ->
Key = rand:uniform(A1),
_V = ?MODULE:Fun({value, test, 1500, 1500}),
call2(N - 1, A1, A2, A, Fun, Key).
call3(N, Y) ->
A = ?MODULE,
Fun = get1,
T = erlang:system_time(microsecond),
call3(N, Y, T, A, Fun, 0).
call3(0, _A1, A2, A, Fun, _K) ->
_V = erlang:apply(A, Fun, [{value, test, 1500, 1500}]),
{erlang:system_time(microsecond) - A2, _K};
call3(N, A1, A2, A, Fun, _key) ->
Key = rand:uniform(A1),
_V = erlang:apply(A, Fun, [{value, test, 1500, 1500}]),
call3(N - 1, A1, A2, A, Fun, Key).
call4(N, Y) ->
A = ?MODULE,
Fun = get1,
T = erlang:system_time(microsecond),
call4(N, Y, T, A, Fun, 0).
call4(0, _A1, A2, A, Fun, _K) ->
erlang:apply(A, Fun, [{value, test, 1500, 1500}]),
{erlang:system_time(microsecond) - A2, _K};
call4(N, A1, A2, A, Fun, _key) ->
Key = rand:uniform(A1),
Args = [{value, test, 1500, 1500}],
erlang:apply(A, Fun, Args),
call4(N - 1, A1, A2, A, Fun, Key).
-define(AcList, [{eTimeout, 11, 22}, {u_eTimeout, 22}, {sTimeout, 111, 222, 333}, c_eTimeout, c_sTimeout, {nextEvent, 222, fdfd}, {doAfter, args}]).
ht11(0, _Fun) ->
ok;
ht11(N, Fun) ->
?MODULE:Fun(?AcList, 1, ttt, [], true, fasle, false, [], []),
ht11(N - 1, Fun).
%%
doPAL([], _CallbackForm, CycleData, Debug, IsPostpone, IsHibernate, DoAfter, Timeouts, NextEvents) ->
@ -206,20 +206,20 @@ doPAL2([OneAction | LeftActions], CallbackForm, CycleData, Debug, IsPostpone, Is
ok;
{nextEvent, Type, Content} when CallbackForm == 1 orelse CallbackForm == 2 ->
ok;
%% next_event动作
%% next_event动作
_ActRet ->
ok
end.
-define(htList, [
{test1, kkk1, 22},
{test2, kkk},
{test3, kkk, 66, yy},
{test4, kkk, tt, tt},
{test5, kkk, [11,55, yy]},
{test6, kkk, 1 ,2, 3},
{test7, gfg}
]).
-define( htList, [
{test1, kkk1, 22},
{test2, kkk},
{test3, kkk, 66, yy},
{test4, kkk, tt, tt},
{test5, kkk, [11, 55, yy]},
{test6, kkk, 1, 2, 3},
{test7, gfg}
]).
hht1(0, _Fun) ->
@ -242,9 +242,9 @@ hand({test3, kkk, 66, yy}) ->
vv3;
hand({test4, kkk, _, _}) ->
vv4;
hand({test5, kkk, [11,55, yy]}) ->
hand({test5, kkk, [11, 55, yy]}) ->
vv5;
hand({test6, kkk, _ ,_, _}) ->
hand({test6, kkk, _, _, _}) ->
vv6;
hand({test7, _}) ->
vv7;
@ -259,9 +259,9 @@ hand1(test3, {test3, kkk, 66, yy}) ->
vv3;
hand1(test4, {test4, kkk, _, _}) ->
vv4;
hand1(test5, {test5, kkk, [11,55, yy]}) ->
hand1(test5, {test5, kkk, [11, 55, yy]}) ->
vv5;
hand1(test6, {test6, kkk,_ , _, _}) ->
hand1(test6, {test6, kkk, _, _, _}) ->
vv6;
hand1(test7, {test7, _}) ->
vv7;
@ -276,9 +276,9 @@ hand2({test3, kkk, 66, yy}) ->
vv3;
hand2({test4, kkk, {11, 22}}) ->
vv4;
hand2({test5, kkk, [11,55, yy]}) ->
hand2({test5, kkk, [11, 55, yy]}) ->
vv5;
hand2({test6, kkk,_ ,_, _}) ->
hand2({test6, kkk, _, _, _}) ->
vv6;
hand2({test7, kkk, _}) ->
vv7;

Načítá se…
Zrušit
Uložit