aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2009-12-10 10:21:55 +0100
committerBjörn Gustavsson <[email protected]>2009-12-13 15:42:36 +0100
commit7ab33f49185d5a416198f1e0bf5a2ca9f347bbac (patch)
tree80e5c93a0df2b1583601d2fcfff29071918715e7 /lib/compiler/test
parent9855ed863b58f7325f39b00c60813198ec41f528 (diff)
downloadotp-7ab33f49185d5a416198f1e0bf5a2ca9f347bbac.tar.gz
otp-7ab33f49185d5a416198f1e0bf5a2ca9f347bbac.tar.bz2
otp-7ab33f49185d5a416198f1e0bf5a2ca9f347bbac.zip
Change the expected return value for on_load functions
An on_load function is supposed to return 'true' to indicate that the module should be loaded, and 'false' if it should be unloaded. But returning any other term, as well as causing an exception, will also unload the module. Since we don't like boolean values mixed with other values, change the expected return value as follows: * If 'ok' is returned, the module will remain loaded and become callable. * If any other value is returned (or an exception is generated), the module will be unloaded. Also, if the returned value is not an atom, send a warning message to the error_logger (using error_logger:warning_msg/2). The new interpretation of the return value means that an on_load function can now directly return the return value from erlang:load_nif/2.
Diffstat (limited to 'lib/compiler/test')
-rw-r--r--lib/compiler/test/compilation_SUITE_data/on_load.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compiler/test/compilation_SUITE_data/on_load.erl b/lib/compiler/test/compilation_SUITE_data/on_load.erl
index 92bcf74624..e9b5ec7f34 100644
--- a/lib/compiler/test/compilation_SUITE_data/on_load.erl
+++ b/lib/compiler/test/compilation_SUITE_data/on_load.erl
@@ -12,7 +12,7 @@
do_on_load() ->
local_function(),
- true.
+ ok.
local_function() ->
ok.