summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTomoyuki Sahara <[email protected]>2014-04-05 11:55:51 +0900
committerTomoyuki Sahara <[email protected]>2014-04-05 11:55:51 +0900
commita6ab2c54f3a0cfaebefb8090fd5bc43fb3da3177 (patch)
tree69b5d7238b523c7c652a12b9ddcdc784c18a4a16
parent083cd9ca8cda20a4a268d5ed2d95d738ab4f4460 (diff)
parent706ef1337a8fccea8d75a10d73701e536d4f79b1 (diff)
downloadmruby-a6ab2c54f3a0cfaebefb8090fd5bc43fb3da3177.tar.gz
mruby-a6ab2c54f3a0cfaebefb8090fd5bc43fb3da3177.zip
Merge pull request #15 from monami-ya-mrb/pr-add-error-check-in-test
Don't ignore the return value of symlink().
-rw-r--r--test/mruby_io_test.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/mruby_io_test.c b/test/mruby_io_test.c
index 6a3b20f62..36e56b87c 100644
--- a/test/mruby_io_test.c
+++ b/test/mruby_io_test.c
@@ -112,7 +112,9 @@ static mrb_value
mrb_io_test_file_setup(mrb_state *mrb, mrb_value self)
{
mrb_value ary = mrb_io_test_io_setup(mrb, self);
- symlink("/usr/bin", "test-bin");
+ if (symlink("/usr/bin", "test-bin") == -1) {
+ mrb_raise(mrb, E_RUNTIME_ERROR, "can't make a symbolic link");
+ }
return ary;
}