diff options
author | Sverker Eriksson <[email protected]> | 2017-08-30 20:55:08 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2017-08-30 20:55:08 +0200 |
commit | 7c67bbddb53c364086f66260701bc54a61c9659c (patch) | |
tree | 92ab0d4b91d5e2f6e7a3f9d61ea25089e8a71fe0 /erts/emulator/test/evil_SUITE.erl | |
parent | 97dc5e7f396129222419811c173edc7fa767b0f8 (diff) | |
parent | 3b7a6ffddc819bf305353a593904cea9e932e7dc (diff) | |
download | otp-7c67bbddb53c364086f66260701bc54a61c9659c.tar.gz otp-7c67bbddb53c364086f66260701bc54a61c9659c.tar.bz2 otp-7c67bbddb53c364086f66260701bc54a61c9659c.zip |
Merge tag 'OTP-19.0' into sverker/19/binary_to_atom-utf8-crash/ERL-474/OTP-14590
Diffstat (limited to 'erts/emulator/test/evil_SUITE.erl')
-rw-r--r-- | erts/emulator/test/evil_SUITE.erl | 485 |
1 files changed, 229 insertions, 256 deletions
diff --git a/erts/emulator/test/evil_SUITE.erl b/erts/emulator/test/evil_SUITE.erl index f982b9d4ff..9416ac7a02 100644 --- a/erts/emulator/test/evil_SUITE.erl +++ b/erts/emulator/test/evil_SUITE.erl @@ -1,40 +1,40 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2011. All Rights Reserved. +%% Copyright Ericsson AB 2002-2016. All Rights Reserved. %% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. %% %% %CopyrightEnd% -module(evil_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, - init_per_group/2,end_per_group/2, - init_per_testcase/2,end_per_testcase/2, - heap_frag/1, - encode_decode_ext/1, - decode_integer_ext/1, - decode_small_big_ext/1, - decode_large_big_ext/1, - decode_small_big_ext_neg/1, - decode_large_big_ext_neg/1, - decode_too_small/1, - decode_pos_neg_zero/1 - ]). +-export([all/0, suite/0, + heap_frag/1, + encode_decode_ext/1, + decode_integer_ext/1, + decode_small_big_ext/1, + decode_large_big_ext/1, + decode_small_big_ext_neg/1, + decode_large_big_ext_neg/1, + decode_too_small/1, + decode_pos_neg_zero/1]). --include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -suite() -> [{ct_hooks,[ts_install_cth]}]. +suite() -> + [{ct_hooks,[ts_install_cth]}, + {timetrap, {seconds, 30}}]. all() -> [heap_frag, encode_decode_ext, decode_integer_ext, @@ -42,41 +42,16 @@ all() -> decode_small_big_ext_neg, decode_large_big_ext_neg, decode_too_small, decode_pos_neg_zero]. -groups() -> - []. - -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - -init_per_group(_GroupName, Config) -> - Config. - -end_per_group(_GroupName, Config) -> - Config. - - -init_per_testcase(_Case, Config) -> - ?line Dog = test_server:timetrap(?t:minutes(0.5)), - [{watchdog, Dog}|Config]. - -end_per_testcase(_Case, Config) -> - Dog=?config(watchdog, Config), - test_server:timetrap_cancel(Dog), - ok. - heap_frag(Config) when is_list(Config) -> N = 512, Self = self(), - ?line Pid = spawn_link(fun() -> appender(Self, N) end), + Pid = spawn_link(fun() -> appender(Self, N) end), receive - {Pid,Res} -> - ?line Res = my_appender(N); - Garbage -> - io:format("Garbage: ~p\n", [Garbage]), - ?line ?t:fail(got_garbage) + {Pid,Res} -> + Res = my_appender(N); + Garbage -> + io:format("Garbage: ~p\n", [Garbage]), + ct:fail(got_garbage) end. @@ -86,29 +61,28 @@ heap_frag(Config) when is_list(Config) -> %% These test cases are not "evil" but the next test case is.... encode_decode_ext(Config) when is_list(Config) -> - ?line enc_dec( 2, 0), % SMALL_INTEGER_EXT smallest - ?line enc_dec( 2, 255), % SMALL_INTEGER_EXT largest - ?line enc_dec( 5, 256), % INTEGER_EXT smallest pos (*) - ?line enc_dec( 5, -1), % INTEGER_EXT largest neg - - ?line enc_dec( 5, 16#07ffffff), % INTEGER_EXT largest (28 bits) - ?line enc_dec( 5,-16#08000000), % INTEGER_EXT smallest - ?line enc_dec( 7, 16#08000000), % SMALL_BIG_EXT smallest pos(*) - ?line enc_dec( 7,-16#08000001), % SMALL_BIG_EXT largest neg (*) - - ?line enc_dec( 7, 16#7fffffff), % SMALL_BIG_EXT largest i32 - ?line enc_dec( 7,-16#80000000), % SMALL_BIG_EXT smallest i32 - - ?line enc_dec( 7, 16#80000000), % SMALL_BIG_EXT u32 - ?line enc_dec( 7, 16#ffffffff), % SMALL_BIG_EXT largest u32 - - ?line enc_dec( 9, 16#7fffffffffff), % largest i48 - ?line enc_dec( 9,-16#800000000000), % smallest i48 - ?line enc_dec( 9, 16#ffffffffffff), % largest u48 - ?line enc_dec(11, 16#7fffffffffffffff), % largest i64 - ?line enc_dec(11,-16#8000000000000000), % smallest i64 - ?line enc_dec(11, 16#ffffffffffffffff), % largest u64 - + enc_dec( 2, 0), % SMALL_INTEGER_EXT smallest + enc_dec( 2, 255), % SMALL_INTEGER_EXT largest + enc_dec( 5, 256), % INTEGER_EXT smallest pos (*) + enc_dec( 5, -1), % INTEGER_EXT largest neg + + enc_dec( 5, 16#07ffffff), % INTEGER_EXT largest (28 bits) + enc_dec( 5,-16#08000000), % INTEGER_EXT smallest + enc_dec( 7, 16#08000000), % SMALL_BIG_EXT smallest pos(*) + enc_dec( 7,-16#08000001), % SMALL_BIG_EXT largest neg (*) + + enc_dec( 7, 16#7fffffff), % SMALL_BIG_EXT largest i32 + enc_dec( 7,-16#80000000), % SMALL_BIG_EXT smallest i32 + + enc_dec( 7, 16#80000000), % SMALL_BIG_EXT u32 + enc_dec( 7, 16#ffffffff), % SMALL_BIG_EXT largest u32 + + enc_dec( 9, 16#7fffffffffff), % largest i48 + enc_dec( 9,-16#800000000000), % smallest i48 + enc_dec( 9, 16#ffffffffffff), % largest u48 + enc_dec(11, 16#7fffffffffffffff), % largest i64 + enc_dec(11,-16#8000000000000000), % smallest i64 + enc_dec(11, 16#ffffffffffffffff), % largest u64 ok. @@ -124,213 +98,213 @@ encode_decode_ext(Config) when is_list(Config) -> %% erl_interface, i.e. not how it is encoded in the test case below. decode_integer_ext(Config) when is_list(Config) -> - ?line decode( 0, <<131,98, 0:32>>), % SMALL_INTEGER_EXT - ?line decode( 42, <<131,98, 42:32>>), % SMALL_INTEGER_EXT - ?line decode(255, <<131,98,255:32>>), % SMALL_INTEGER_EXT - ?line decode( 16#08000000, <<131,98, 16#08000000:32>>), % SMALL_BIG_EXT - ?line decode(-16#08000001, <<131,98,-16#08000001:32>>), % SMALL_BIG_EXT - ?line decode( 16#7fffffff, <<131,98, 16#7fffffff:32>>), % SMALL_BIG_EXT - ?line decode(-16#80000000, <<131,98,-16#80000000:32>>), % SMALL_BIG_EXT + decode( 0, <<131,98, 0:32>>), % SMALL_INTEGER_EXT + decode( 42, <<131,98, 42:32>>), % SMALL_INTEGER_EXT + decode(255, <<131,98,255:32>>), % SMALL_INTEGER_EXT + decode( 16#08000000, <<131,98, 16#08000000:32>>), % SMALL_BIG_EXT + decode(-16#08000001, <<131,98,-16#08000001:32>>), % SMALL_BIG_EXT + decode( 16#7fffffff, <<131,98, 16#7fffffff:32>>), % SMALL_BIG_EXT + decode(-16#80000000, <<131,98,-16#80000000:32>>), % SMALL_BIG_EXT ok. decode_small_big_ext(Config) when is_list(Config) -> - ?line decode(256,<<131,110,2,0,0,1>>), % INTEGER_EXT - ?line decode(16#07ffffff,<<131,110,4,0,255,255,255,7>>), % INTEGER_EXT - ?line decode(16#7fffffff,<<131,110,4,0,255,255,255,127>>), % SMALL_BIG_EXT - - ?line decode(42,<<131,110,1,0,42>>), % SMALL_INTEGER_EXT - ?line decode(42,<<131,110,2,0,42,0>>), % Redundant zeros from now on - ?line decode(42,<<131,110,3,0,42,0,0>>), - ?line decode(42,<<131,110,4,0,42,0,0,0>>), - ?line decode(42,<<131,110,5,0,42,0,0,0,0>>), - ?line decode(42,<<131,110,6,0,42,0,0,0,0,0>>), - ?line decode(42,<<131,110,7,0,42,0,0,0,0,0,0>>), - ?line decode(42,<<131,110,8,0,42,0,0,0,0,0,0,0>>), + decode(256,<<131,110,2,0,0,1>>), % INTEGER_EXT + decode(16#07ffffff,<<131,110,4,0,255,255,255,7>>), % INTEGER_EXT + decode(16#7fffffff,<<131,110,4,0,255,255,255,127>>), % SMALL_BIG_EXT + + decode(42,<<131,110,1,0,42>>), % SMALL_INTEGER_EXT + decode(42,<<131,110,2,0,42,0>>), % Redundant zeros from now on + decode(42,<<131,110,3,0,42,0,0>>), + decode(42,<<131,110,4,0,42,0,0,0>>), + decode(42,<<131,110,5,0,42,0,0,0,0>>), + decode(42,<<131,110,6,0,42,0,0,0,0,0>>), + decode(42,<<131,110,7,0,42,0,0,0,0,0,0>>), + decode(42,<<131,110,8,0,42,0,0,0,0,0,0,0>>), ok. decode_large_big_ext(Config) when is_list(Config) -> - ?line decode(256,<<131,111,2:32,0,0,1>>), % INTEGER_EXT - ?line decode(16#07ffffff,<<131,111,4:32,0,255,255,255,7>>), % INTEG_EXT - ?line decode(16#7fffffff,<<131,111,4:32,0,255,255,255,127>>), % SMA_BIG - ?line decode(16#ffffffff,<<131,111,4:32,0,255,255,255,255>>), % SMA_BIG + decode(256,<<131,111,2:32,0,0,1>>), % INTEGER_EXT + decode(16#07ffffff,<<131,111,4:32,0,255,255,255,7>>), % INTEG_EXT + decode(16#7fffffff,<<131,111,4:32,0,255,255,255,127>>), % SMA_BIG + decode(16#ffffffff,<<131,111,4:32,0,255,255,255,255>>), % SMA_BIG N = largest_small_big(), - ?line decode(N,<<131,111,255:32,0,N:2040/little>>), % SMALL_BIG_EXT - - ?line decode(42,<<131,111,1:32,0,42>>), - ?line decode(42,<<131,111,2:32,0,42,0>>), % Redundant zeros from now on - ?line decode(42,<<131,111,3:32,0,42,0,0>>), - ?line decode(42,<<131,111,4:32,0,42,0,0,0>>), - ?line decode(42,<<131,111,5:32,0,42,0,0,0,0>>), - ?line decode(42,<<131,111,6:32,0,42,0,0,0,0,0>>), - ?line decode(42,<<131,111,7:32,0,42,0,0,0,0,0,0>>), - ?line decode(42,<<131,111,8:32,0,42,0,0,0,0,0,0,0>>), + decode(N,<<131,111,255:32,0,N:2040/little>>), % SMALL_BIG_EXT + + decode(42,<<131,111,1:32,0,42>>), + decode(42,<<131,111,2:32,0,42,0>>), % Redundant zeros from now on + decode(42,<<131,111,3:32,0,42,0,0>>), + decode(42,<<131,111,4:32,0,42,0,0,0>>), + decode(42,<<131,111,5:32,0,42,0,0,0,0>>), + decode(42,<<131,111,6:32,0,42,0,0,0,0,0>>), + decode(42,<<131,111,7:32,0,42,0,0,0,0,0,0>>), + decode(42,<<131,111,8:32,0,42,0,0,0,0,0,0,0>>), ok. decode_small_big_ext_neg(Config) when is_list(Config) -> - ?line decode(-1,<<131,110,1,1,1>>), % INTEGER_EXT - ?line decode(-16#08000000,<<131,110,4,1,0,0,0,8>>), % INTEGER_EXT - ?line decode(-16#80000000,<<131,110,4,1,0,0,0,128>>), % SMALL_BIG_EXT - ?line decode(-16#ffffffff,<<131,110,4,1,255,255,255,255>>), % SMALL_BIG_EXT + decode(-1,<<131,110,1,1,1>>), % INTEGER_EXT + decode(-16#08000000,<<131,110,4,1,0,0,0,8>>), % INTEGER_EXT + decode(-16#80000000,<<131,110,4,1,0,0,0,128>>), % SMALL_BIG_EXT + decode(-16#ffffffff,<<131,110,4,1,255,255,255,255>>), % SMALL_BIG_EXT N = largest_small_big(), - ?line decode(-N,<<131,111,255:32,1,N:2040/little>>), % SMALL_BIG_EXT - - ?line decode(-42,<<131,110,1,1,42>>), - ?line decode(-42,<<131,110,2,1,42,0>>), % Redundant zeros from now on - ?line decode(-42,<<131,110,3,1,42,0,0>>), - ?line decode(-42,<<131,110,4,1,42,0,0,0>>), - ?line decode(-42,<<131,110,5,1,42,0,0,0,0>>), - ?line decode(-42,<<131,110,6,1,42,0,0,0,0,0>>), - ?line decode(-42,<<131,110,7,1,42,0,0,0,0,0,0>>), - ?line decode(-42,<<131,110,8,1,42,0,0,0,0,0,0,0>>), + decode(-N,<<131,111,255:32,1,N:2040/little>>), % SMALL_BIG_EXT + + decode(-42,<<131,110,1,1,42>>), + decode(-42,<<131,110,2,1,42,0>>), % Redundant zeros from now on + decode(-42,<<131,110,3,1,42,0,0>>), + decode(-42,<<131,110,4,1,42,0,0,0>>), + decode(-42,<<131,110,5,1,42,0,0,0,0>>), + decode(-42,<<131,110,6,1,42,0,0,0,0,0>>), + decode(-42,<<131,110,7,1,42,0,0,0,0,0,0>>), + decode(-42,<<131,110,8,1,42,0,0,0,0,0,0,0>>), ok. decode_large_big_ext_neg(Config) when is_list(Config) -> - ?line decode(-1,<<131,111,1:32,1,1>>), % INTEGER_EXT - ?line decode(-16#08000000,<<131,111,4:32,1,0,0,0,8>>), % INTEGER_EXT - ?line decode(-16#80000000,<<131,111,4:32,1,0,0,0,128>>), % SMALL_BIG_EXT - - ?line decode(-42,<<131,111,1:32,1,42>>), - ?line decode(-42,<<131,111,2:32,1,42,0>>), % Redundant zeros from now on - ?line decode(-42,<<131,111,3:32,1,42,0,0>>), - ?line decode(-42,<<131,111,4:32,1,42,0,0,0>>), - ?line decode(-42,<<131,111,5:32,1,42,0,0,0,0>>), - ?line decode(-42,<<131,111,6:32,1,42,0,0,0,0,0>>), - ?line decode(-42,<<131,111,7:32,1,42,0,0,0,0,0,0>>), - ?line decode(-42,<<131,111,8:32,1,42,0,0,0,0,0,0,0>>), + decode(-1,<<131,111,1:32,1,1>>), % INTEGER_EXT + decode(-16#08000000,<<131,111,4:32,1,0,0,0,8>>), % INTEGER_EXT + decode(-16#80000000,<<131,111,4:32,1,0,0,0,128>>), % SMALL_BIG_EXT + + decode(-42,<<131,111,1:32,1,42>>), + decode(-42,<<131,111,2:32,1,42,0>>), % Redundant zeros from now on + decode(-42,<<131,111,3:32,1,42,0,0>>), + decode(-42,<<131,111,4:32,1,42,0,0,0>>), + decode(-42,<<131,111,5:32,1,42,0,0,0,0>>), + decode(-42,<<131,111,6:32,1,42,0,0,0,0,0>>), + decode(-42,<<131,111,7:32,1,42,0,0,0,0,0,0>>), + decode(-42,<<131,111,8:32,1,42,0,0,0,0,0,0,0>>), ok. decode_pos_neg_zero(Config) when is_list(Config) -> - ?line decode( 0, <<131,110,0,0>>), % SMALL_BIG_EXT (positive zero) - ?line decode( 0, <<131,110,1,0,0>>), % SMALL_BIG_EXT (positive zero) - ?line decode( 0, <<131,110,0,1>>), % SMALL_BIG_EXT (negative zero) - ?line decode( 0, <<131,110,1,1,0>>), % SMALL_BIG_EXT (negative zero) + decode( 0, <<131,110,0,0>>), % SMALL_BIG_EXT (positive zero) + decode( 0, <<131,110,1,0,0>>), % SMALL_BIG_EXT (positive zero) + decode( 0, <<131,110,0,1>>), % SMALL_BIG_EXT (negative zero) + decode( 0, <<131,110,1,1,0>>), % SMALL_BIG_EXT (negative zero) - ?line decode( 0, <<131,111,0:32,0>>), % SMALL_BIG_EXT (positive zero) - ?line decode( 0, <<131,111,1:32,0,0>>), % SMALL_BIG_EXT (positive zero) - ?line decode( 0, <<131,111,0:32,1>>), % SMALL_BIG_EXT (negative zero) - ?line decode( 0, <<131,111,1:32,1,0>>), % SMALL_BIG_EXT (negative zero) + decode( 0, <<131,111,0:32,0>>), % SMALL_BIG_EXT (positive zero) + decode( 0, <<131,111,1:32,0,0>>), % SMALL_BIG_EXT (positive zero) + decode( 0, <<131,111,0:32,1>>), % SMALL_BIG_EXT (negative zero) + decode( 0, <<131,111,1:32,1,0>>), % SMALL_BIG_EXT (negative zero) N = largest_small_big(), - ?line decode( N,<<131,110,255,0,N:2040/little>>), % largest SMALL_BIG_EXT - ?line decode(-N,<<131,110,255,1,N:2040/little>>), % largest SMALL_BIG_EXT + decode( N,<<131,110,255,0,N:2040/little>>), % largest SMALL_BIG_EXT + decode(-N,<<131,110,255,1,N:2040/little>>), % largest SMALL_BIG_EXT ok. %% Test to decode uncompleted encodings for all in "erl_ext_dist.txt" decode_too_small(Config) when is_list(Config) -> - ?line decode_badarg(<<131, 97>>), - ?line decode_badarg(<<131, 98>>), - ?line decode_badarg(<<131, 98, 0>>), - ?line decode_badarg(<<131, 98, 0, 0>>), - ?line decode_badarg(<<131, 98, 0, 0, 0>>), - ?line decode_badarg(<<131, 99>>), - ?line decode_badarg(<<131, 99, 0>>), - ?line decode_badarg(<<131, 99, 0:240>>), - - ?line decode_badarg(<<131,100>>), - ?line decode_badarg(<<131,100, 1:16/big>>), - ?line decode_badarg(<<131,100, 2:16/big>>), - ?line decode_badarg(<<131,100, 2:16/big, "A">>), + decode_badarg(<<131, 97>>), + decode_badarg(<<131, 98>>), + decode_badarg(<<131, 98, 0>>), + decode_badarg(<<131, 98, 0, 0>>), + decode_badarg(<<131, 98, 0, 0, 0>>), + decode_badarg(<<131, 99>>), + decode_badarg(<<131, 99, 0>>), + decode_badarg(<<131, 99, 0:240>>), + + decode_badarg(<<131,100>>), + decode_badarg(<<131,100, 1:16/big>>), + decode_badarg(<<131,100, 2:16/big>>), + decode_badarg(<<131,100, 2:16/big, "A">>), % FIXME node name "A" seem ok, should it be? -% ?line decode_badarg(<<131,101,100,1:16/big,"A",42:32/big,0>>), - - ?line decode_badarg(<<131,101>>), - ?line decode_badarg(<<131,101,106>>), - ?line decode_badarg(<<131,101,255>>), - ?line decode_badarg(<<131,101,106,42:8/big>>), - ?line decode_badarg(<<131,101,106,42:16/big>>), - ?line decode_badarg(<<131,101,255,42:24/big>>), - ?line decode_badarg(<<131,101,255,42:32/big,0>>), - ?line decode_badarg(<<131,101,100,1:16/big,"A">>), - ?line decode_badarg(<<131,101,100,1:16/big,"A",42:32/big>>), - - ?line decode_badarg(<<131,102>>), - ?line decode_badarg(<<131,102,106,42:32/big,0>>), - ?line decode_badarg(<<131,102,255,42:32/big,0>>), - ?line decode_badarg(<<131,102,100,1:16/big,"A">>), - ?line decode_badarg(<<131,102,100,1:16/big,"A",42:32/big>>), - - ?line decode_badarg(<<131,103>>), - ?line decode_badarg(<<131,103,106,42:32/big,0>>), - ?line decode_badarg(<<131,103,255,42:32/big,0>>), - ?line decode_badarg(<<131,103,100,1:16/big,"A">>), - ?line decode_badarg(<<131,103,100,1:16/big,"A",42:32/big>>), - ?line decode_badarg(<<131,103,100,1:16/big,"A",4:32/big,2:32/big>>), - - ?line decode_badarg(<<131,104>>), - ?line decode_badarg(<<131,104, 1>>), - ?line decode_badarg(<<131,104, 2, 106>>), - ?line decode_badarg(<<131,105, 1:32/big>>), - ?line decode_badarg(<<131,105, 2:32/big, 106>>), - - ?line decode_badarg(<<131,107>>), - ?line decode_badarg(<<131,107, 1:16/big>>), - ?line decode_badarg(<<131,107, 2:16/big>>), - ?line decode_badarg(<<131,107, 2:16/big, "A">>), - - ?line decode_badarg(<<131,108>>), - ?line decode_badarg(<<131,108, 1:32/big>>), - ?line decode_badarg(<<131,108, 2:32/big>>), - ?line decode_badarg(<<131,108, 2:32/big, 106>>), % FIXME don't use NIL - - ?line decode_badarg(<<131,109>>), - ?line decode_badarg(<<131,109, 1:32/big>>), - ?line decode_badarg(<<131,109, 2:32/big>>), - ?line decode_badarg(<<131,109, 2:32/big, 42>>), + % decode_badarg(<<131,101,100,1:16/big,"A",42:32/big,0>>), + + decode_badarg(<<131,101>>), + decode_badarg(<<131,101,106>>), + decode_badarg(<<131,101,255>>), + decode_badarg(<<131,101,106,42:8/big>>), + decode_badarg(<<131,101,106,42:16/big>>), + decode_badarg(<<131,101,255,42:24/big>>), + decode_badarg(<<131,101,255,42:32/big,0>>), + decode_badarg(<<131,101,100,1:16/big,"A">>), + decode_badarg(<<131,101,100,1:16/big,"A",42:32/big>>), + + decode_badarg(<<131,102>>), + decode_badarg(<<131,102,106,42:32/big,0>>), + decode_badarg(<<131,102,255,42:32/big,0>>), + decode_badarg(<<131,102,100,1:16/big,"A">>), + decode_badarg(<<131,102,100,1:16/big,"A",42:32/big>>), + + decode_badarg(<<131,103>>), + decode_badarg(<<131,103,106,42:32/big,0>>), + decode_badarg(<<131,103,255,42:32/big,0>>), + decode_badarg(<<131,103,100,1:16/big,"A">>), + decode_badarg(<<131,103,100,1:16/big,"A",42:32/big>>), + decode_badarg(<<131,103,100,1:16/big,"A",4:32/big,2:32/big>>), + + decode_badarg(<<131,104>>), + decode_badarg(<<131,104, 1>>), + decode_badarg(<<131,104, 2, 106>>), + decode_badarg(<<131,105, 1:32/big>>), + decode_badarg(<<131,105, 2:32/big, 106>>), + + decode_badarg(<<131,107>>), + decode_badarg(<<131,107, 1:16/big>>), + decode_badarg(<<131,107, 2:16/big>>), + decode_badarg(<<131,107, 2:16/big, "A">>), + + decode_badarg(<<131,108>>), + decode_badarg(<<131,108, 1:32/big>>), + decode_badarg(<<131,108, 2:32/big>>), + decode_badarg(<<131,108, 2:32/big, 106>>), % FIXME don't use NIL + + decode_badarg(<<131,109>>), + decode_badarg(<<131,109, 1:32/big>>), + decode_badarg(<<131,109, 2:32/big>>), + decode_badarg(<<131,109, 2:32/big, 42>>), N = largest_small_big(), - ?line decode_badarg(<<131,110>>), - ?line decode_badarg(<<131,110,1>>), - ?line decode_badarg(<<131,110,1,0>>), - ?line decode_badarg(<<131,110,1,1>>), - ?line decode_badarg(<<131,110,2,0,42>>), - ?line decode_badarg(<<131,110,2,1,42>>), - ?line decode_badarg(<<131,110,255,0,N:2032/little>>), - ?line decode_badarg(<<131,110,255,1,N:2032/little>>), - - ?line decode_badarg(<<131,111>>), - ?line decode_badarg(<<131,111, 1:32/big>>), - ?line decode_badarg(<<131,111, 1:32/big,0>>), - ?line decode_badarg(<<131,111, 1:32/big,1>>), - ?line decode_badarg(<<131,111, 2:32/big,0,42>>), - ?line decode_badarg(<<131,111, 2:32/big,1,42>>), - ?line decode_badarg(<<131,111,256:32/big,0,N:2032/little>>), - ?line decode_badarg(<<131,111,256:32/big,1,N:2032/little>>), - ?line decode_badarg(<<131,111,256:32/big,0,N:2040/little>>), - ?line decode_badarg(<<131,111,256:32/big,1,N:2040/little>>), - ?line decode_badarg(<<131,111,257:32/big,0,N:2048/little>>), - ?line decode_badarg(<<131,111,257:32/big,1,N:2048/little>>), + decode_badarg(<<131,110>>), + decode_badarg(<<131,110,1>>), + decode_badarg(<<131,110,1,0>>), + decode_badarg(<<131,110,1,1>>), + decode_badarg(<<131,110,2,0,42>>), + decode_badarg(<<131,110,2,1,42>>), + decode_badarg(<<131,110,255,0,N:2032/little>>), + decode_badarg(<<131,110,255,1,N:2032/little>>), + + decode_badarg(<<131,111>>), + decode_badarg(<<131,111, 1:32/big>>), + decode_badarg(<<131,111, 1:32/big,0>>), + decode_badarg(<<131,111, 1:32/big,1>>), + decode_badarg(<<131,111, 2:32/big,0,42>>), + decode_badarg(<<131,111, 2:32/big,1,42>>), + decode_badarg(<<131,111,256:32/big,0,N:2032/little>>), + decode_badarg(<<131,111,256:32/big,1,N:2032/little>>), + decode_badarg(<<131,111,256:32/big,0,N:2040/little>>), + decode_badarg(<<131,111,256:32/big,1,N:2040/little>>), + decode_badarg(<<131,111,257:32/big,0,N:2048/little>>), + decode_badarg(<<131,111,257:32/big,1,N:2048/little>>), % Emulator dies if trying to create large bignum.... -% ?line decode_badarg(<<131,111,16#ffffffff:32/big,0>>), -% ?line decode_badarg(<<131,111,16#ffffffff:32/big,1>>), - - ?line decode_badarg(<<131, 78>>), - ?line decode_badarg(<<131, 78, 42>>), - ?line decode_badarg(<<131, 78, 42, 1>>), - ?line decode_badarg(<<131, 78, 42, 1:16/big>>), - ?line decode_badarg(<<131, 78, 42, 2:16/big>>), - ?line decode_badarg(<<131, 78, 42, 2:16/big, "A">>), - - ?line decode_badarg(<<131, 67>>), - - ?line decode_badarg(<<131,114>>), - ?line decode_badarg(<<131,114,0>>), - ?line decode_badarg(<<131,114,1:16/big>>), - ?line decode_badarg(<<131,114,1:16/big,100>>), - ?line decode_badarg(<<131,114,1:16/big,100,1:16/big>>), - ?line decode_badarg(<<131,114,1:16/big,100,1:16/big,"A">>), - ?line decode_badarg(<<131,114,1:16/big,100,1:16/big,"A",0>>), - ?line decode_badarg(<<131,114,1:16/big,100,1:16/big,"A",0,42:8>>), - ?line decode_badarg(<<131,114,1:16/big,100,1:16/big,"A",0,42:16>>), - ?line decode_badarg(<<131,114,1:16/big,100,1:16/big,"A",0,42:24>>), - - ?line decode_badarg(<<131,117>>), % FIXME needs more tests + % decode_badarg(<<131,111,16#ffffffff:32/big,0>>), + % decode_badarg(<<131,111,16#ffffffff:32/big,1>>), + + decode_badarg(<<131, 78>>), + decode_badarg(<<131, 78, 42>>), + decode_badarg(<<131, 78, 42, 1>>), + decode_badarg(<<131, 78, 42, 1:16/big>>), + decode_badarg(<<131, 78, 42, 2:16/big>>), + decode_badarg(<<131, 78, 42, 2:16/big, "A">>), + + decode_badarg(<<131, 67>>), + + decode_badarg(<<131,114>>), + decode_badarg(<<131,114,0>>), + decode_badarg(<<131,114,1:16/big>>), + decode_badarg(<<131,114,1:16/big,100>>), + decode_badarg(<<131,114,1:16/big,100,1:16/big>>), + decode_badarg(<<131,114,1:16/big,100,1:16/big,"A">>), + decode_badarg(<<131,114,1:16/big,100,1:16/big,"A",0>>), + decode_badarg(<<131,114,1:16/big,100,1:16/big,"A",0,42:8>>), + decode_badarg(<<131,114,1:16/big,100,1:16/big,"A",0,42:16>>), + decode_badarg(<<131,114,1:16/big,100,1:16/big,"A",0,42:24>>), + + decode_badarg(<<131,117>>), % FIXME needs more tests ok. @@ -379,12 +353,11 @@ my_appender_1(N, T0) -> U = rnd_term(), T = [U|T0], my_appender_1(N-1, T). - + seed() -> - random:seed(3172, 9815, 20129). + rand:seed(exsplus, {3172,9815,20129}). rnd_term() -> - U0 = random:uniform(), + U0 = rand:uniform(), B = <<U0/float>>, {U0,U0 * 2.5 + 3.14,[U0*2.3,B]}. - |