diff options
author | Björn Gustavsson <[email protected]> | 2012-01-24 16:24:41 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2012-01-25 11:13:48 +0100 |
commit | 23ec68ef0f06710733cdfba5fdeaea1d1df789cf (patch) | |
tree | 7218a9f24cb4a4444df0117e981200374b656f97 /lib/stdlib/test | |
parent | 7e6ac31a0c918f42e747628db8fec610f5bd424c (diff) | |
download | otp-23ec68ef0f06710733cdfba5fdeaea1d1df789cf.tar.gz otp-23ec68ef0f06710733cdfba5fdeaea1d1df789cf.tar.bz2 otp-23ec68ef0f06710733cdfba5fdeaea1d1df789cf.zip |
Ensure that generated record operations don't call local functions
Consistently use external (remote) calls to the BIFs element/2,
setelement/3, and is_record/3.
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r-- | lib/stdlib/test/erl_expand_records_SUITE.erl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/stdlib/test/erl_expand_records_SUITE.erl b/lib/stdlib/test/erl_expand_records_SUITE.erl index f8c1ad783c..8b162cfda0 100644 --- a/lib/stdlib/test/erl_expand_records_SUITE.erl +++ b/lib/stdlib/test/erl_expand_records_SUITE.erl @@ -178,6 +178,9 @@ expr(Config) when is_list(Config) -> true -> not_ok end. + + is_record(_, _, _) -> + error(wrong_is_record). ">> ], @@ -366,6 +369,8 @@ strict(Config) when is_list(Config) -> end catch error:_ -> ok end. + element(_, _) -> + error(wrong_element). ">> ], ?line run(Config, Ts1, [strict_record_tests]), @@ -380,6 +385,8 @@ strict(Config) when is_list(Config) -> case foo of _ when A#r2.a =:= 1 -> ok end. + element(_, _) -> + error(wrong_element). ">> ], ?line run(Config, Ts2, [no_strict_record_tests]), @@ -415,6 +422,11 @@ update(Config) when is_list(Config) -> t2() -> R0 = #r{}, #r{_ = R0#r{a = ok}}. + + %% Implicit calls to setelement/3 must go to the BIF, + %% not to this function. + setelement(_, _, _) -> + erlang:error(wrong_setelement_called). ">> ], ?line run(Config, Ts), |