diff options
author | Patrik Nyblom <[email protected]> | 2010-05-04 14:24:50 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2010-05-17 15:51:50 +0200 |
commit | 0a3305354685b311cfa85b29214b411b24aafcff (patch) | |
tree | 76f041b7bff237dc33ac0d28101cb4452ec99d26 /lib/stdlib/test/binary_module_SUITE.erl | |
parent | ccf8728a95af72aa4847e0844d45dcda991ea435 (diff) | |
download | otp-0a3305354685b311cfa85b29214b411b24aafcff.tar.gz otp-0a3305354685b311cfa85b29214b411b24aafcff.tar.bz2 otp-0a3305354685b311cfa85b29214b411b24aafcff.zip |
Add guard BIFs binary_part/2,3
Add the gc_bif's to the VM.
Add infrastructure for gc_bif's (guard bifs that can gc) with two and.
three arguments in VM (loader and VM).
Add compiler support for gc_bif with three arguments.
Add compiler (and interpreter) support for new guard BIFs.
Add testcases for new guard BIFs in compiler and emulator.
Diffstat (limited to 'lib/stdlib/test/binary_module_SUITE.erl')
-rw-r--r-- | lib/stdlib/test/binary_module_SUITE.erl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/stdlib/test/binary_module_SUITE.erl b/lib/stdlib/test/binary_module_SUITE.erl index c51c70cfa8..4ba3ef4809 100644 --- a/lib/stdlib/test/binary_module_SUITE.erl +++ b/lib/stdlib/test/binary_module_SUITE.erl @@ -2,7 +2,7 @@ -export([all/1, interesting/1,random_ref_comp/1,random_ref_sr_comp/1, random_ref_fla_comp/1,parts/1, bin_to_list/1, list_to_bin/1, - copy/1, referenced/1,encode_decode/1]). + copy/1, referenced/1,guard/1,encode_decode/1]). -export([random_number/1, make_unaligned/1]). @@ -32,7 +32,7 @@ run() -> all(suite) -> [interesting,random_ref_fla_comp,random_ref_sr_comp, random_ref_comp,parts,bin_to_list, list_to_bin, copy, - referenced,encode_decode]. + referenced,guard,encode_decode]. -define(MASK_ERROR(EXPR),mask_error((catch (EXPR)))). @@ -314,7 +314,6 @@ do_interesting(Module) -> ?line <<0>> = ?MASK_ERROR(Module:encode_unsigned(0,big)), ok. - encode_decode(doc) -> ["test binary:encode_unsigned/1,2 and binary:decode_unsigned/1,2"]; encode_decode(Config) when is_list(Config) -> @@ -361,6 +360,11 @@ encode_decode_loop(Range, X) -> exit(mismatch) end. +guard(doc) -> + ["Smoke test of the guard BIFs binary_part/2,3"]; +guard(Config) when is_list(Config) -> + {comment, "Guard tests are run in emulator test suite"}. + referenced(doc) -> ["Test refernced_byte_size/1 bif."]; referenced(Config) when is_list(Config) -> @@ -548,6 +552,8 @@ random_parts(N) -> true = ?MASK_ERROR(binary:part(Str,Z)) =:= ?MASK_ERROR(binref:part(Str,Z)), true = ?MASK_ERROR(binary:part(Str,Z)) =:= + ?MASK_ERROR(erlang:binary_part(Str,Z)), + true = ?MASK_ERROR(binary:part(Str,Z)) =:= ?MASK_ERROR(binary:part(make_unaligned(Str),Z)) end || Z <- Parts1 ], random_parts(N-1). |