diff options
author | Björn Gustavsson <[email protected]> | 2016-01-28 12:17:04 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-01-28 12:17:04 +0100 |
commit | d8161c3ad977c0e20c075ecf58d8ac5769637828 (patch) | |
tree | 8950abfe39252c22c75badbf0cd79bbb9a097a0d /lib/kernel/test/code_SUITE.erl | |
parent | b8c6a1196f0be5a2e98429797b43c24784bcafca (diff) | |
parent | fbfe12dad837300942fc4bf0a3f927b25eaf50a8 (diff) | |
download | otp-d8161c3ad977c0e20c075ecf58d8ac5769637828.tar.gz otp-d8161c3ad977c0e20c075ecf58d8ac5769637828.tar.bz2 otp-d8161c3ad977c0e20c075ecf58d8ac5769637828.zip |
Merge branch 'bjorn/kernel/code/OTP-9375' into maint
* bjorn/kernel/code/OTP-9375:
Update documentation for code-loading functions
code: Correct the types for error returns
Eliminate run-time system crash in code:load_abs/1
Diffstat (limited to 'lib/kernel/test/code_SUITE.erl')
-rw-r--r-- | lib/kernel/test/code_SUITE.erl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl index ef5303defd..2b77ec8972 100644 --- a/lib/kernel/test/code_SUITE.erl +++ b/lib/kernel/test/code_SUITE.erl @@ -323,6 +323,7 @@ load_abs(Config) when is_list(Config) -> {error, nofile} = code:load_abs(TestDir ++ "/duuuumy_mod"), {error, badfile} = code:load_abs(TestDir ++ "/code_a_test"), {'EXIT', _} = (catch code:load_abs({})), + {'EXIT', _} = (catch code:load_abs("Non-latin-имя-файла")), {module, code_b_test} = code:load_abs(TestDir ++ "/code_b_test"), code:stick_dir(TestDir), {error, sticky_directory} = code:load_abs(TestDir ++ "/code_b_test"), @@ -1599,6 +1600,17 @@ on_load_errors(Config) when is_list(Config) -> ok end, + %% Make sure that the code loading functions return the correct + %% error code. + Simple = simple_on_load_error, + SimpleList = atom_to_list(Simple), + {error,on_load_failure} = code:load_file(Simple), + {error,on_load_failure} = code:ensure_loaded(Simple), + {ok,SimpleCode} = file:read_file("simple_on_load_error.beam"), + {error,on_load_failure} = code:load_binary(Simple, "", SimpleCode), + {error,on_load_failure} = code:load_abs(SimpleList), + {error,on_load_failure} = code:load_abs(SimpleList, Simple), + ok. do_on_load_error(ReturnValue) -> |