diff options
author | Björn Gustavsson <[email protected]> | 2013-09-10 09:07:00 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2013-09-18 11:45:00 +0200 |
commit | 84836ff4cee2b1f05d796bb327d0c5138553f6ec (patch) | |
tree | cdbf9466ccafea03a393c94aec424d3fd21f3cf3 /lib/asn1/test/testTimer.erl | |
parent | 85354c27e11e109efb94bd4f867831a295c1a1cf (diff) | |
download | otp-84836ff4cee2b1f05d796bb327d0c5138553f6ec.tar.gz otp-84836ff4cee2b1f05d796bb327d0c5138553f6ec.tar.bz2 otp-84836ff4cee2b1f05d796bb327d0c5138553f6ec.zip |
Don't allow unused exported functions in test case helpers
To keep the test case clean, add an xref test case to ensure that
there are no unused functions in the any of the test case helper
modules. Eliminate 4 functions that were exported just so that
timer:tc/3 could be used (use timer:tc/1 with a fun instead).
Diffstat (limited to 'lib/asn1/test/testTimer.erl')
-rw-r--r-- | lib/asn1/test/testTimer.erl | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/asn1/test/testTimer.erl b/lib/asn1/test/testTimer.erl index 9231ff4a66..0f02bab6e0 100644 --- a/lib/asn1/test/testTimer.erl +++ b/lib/asn1/test/testTimer.erl @@ -18,7 +18,7 @@ %% %% -module(testTimer). --export([go/2,encode/4,decode/5]). +-export([go/2]). -include_lib("test_server/include/test_server.hrl"). @@ -125,7 +125,7 @@ val() -> {'H323-UserInformation_user-data',24,"O"}}. -go(Config,Enc) -> +go(Config, _Enc) -> ?line true = code:add_patha(?config(priv_dir,Config)), Module = 'H323-MESSAGES', @@ -135,13 +135,12 @@ go(Config,Enc) -> CompileOptions = compile_options(), - ?line {ValWr, done} = timer:tc(?MODULE, encode, [?times, Module, Type, Value]), + {ValWr,done} = timer:tc(fun() -> encode(?times, Module, Type, Value) end), ?line io:format("ASN1 encode ~p: ~p micro~n", [CompileOptions, ValWr / ?times]), - ?line done = decode(2,Module,Type,Bytes,Enc), + done = decode(2, Module, Type, Bytes), - ?line {ValRead, done} = timer:tc(?MODULE, decode, [?times, Module, - Type, Bytes,Enc]), + {ValRead,done} = timer:tc(fun() -> decode(?times, Module, Type, Bytes) end), ?line io:format("ASN1 decode ~p: ~p micro~n", [CompileOptions, ValRead /?times]), @@ -160,11 +159,11 @@ encode(N, Module,Type,Value) -> end, encode(N-1, Module,Type,Value). -decode(0, _Module,_Type,_Value,_Erule) -> +decode(0, _Module, _Type, _Value) -> done; -decode(N, Module,Type,Value,Erule) -> - {ok,_B} = asn1rt:decode(Module,Type,Value), - decode(N-1, Module,Type,Value,Erule). +decode(N, Module, Type, Value) -> + {ok,_B} = asn1rt:decode(Module, Type, Value), + decode(N-1, Module, Type, Value). compile_options() -> {ok,Info} = asn1rt:info('H323-MESSAGES'), |