Created
July 6, 2011 11:27
-
-
Save tiesmaster/1067029 to your computer and use it in GitHub Desktop.
build_magik_image() doesn't notify its caller on a failing load_code_proc()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_block | |
_global build_failed | |
build_failed << _false | |
magik_image.register_new("test", | |
:image_file_name, "test", | |
:load_modules, :non_existing_module, | |
:load_code_proc, | |
_proc(mi) | |
_try | |
_with cond | |
mi.sys!perform(:load_code|()|, mi) | |
_when error | |
_global build_failed | |
build_failed << _true | |
write("**** Error: load_code() failed") | |
cond.continue_handling() | |
_endtry | |
_endproc | |
) | |
_local ret << build_magik_image("test") | |
write("build failed?: ", build_failed) | |
_endblock | |
$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_block | |
magik_image.register_new("test", | |
:image_file_name, "test", | |
:load_modules, :non_existing_module | |
) | |
_try | |
_local ret << build_magik_image("test") | |
_if ret _is _unset | |
_then | |
write("[FAIL] expected a return code, or a condition. Neither happened.") | |
_elif ret > 0 | |
_then | |
write("[INFO] build_magik_image() failed, return code > 0, as expected") | |
_endif | |
_when error | |
write("[INFO] build_magik_image() failed with a condition, that's what we want") | |
_endtry | |
_endblock | |
$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment