summaryrefslogtreecommitdiffhomepage
path: root/test/mruby_io_test.c
diff options
context:
space:
mode:
authorEric Hodel <[email protected]>2016-05-12 16:02:09 -0700
committerEric Hodel <[email protected]>2016-05-12 16:02:09 -0700
commit777cf70cc52e52dcce41585db5b19e997b40e65c (patch)
tree95b457c55873d22a3c43ee22930ccda61fb6b29d /test/mruby_io_test.c
parent1c4428880b2f0f0fcd81ea2debc5f4459a7ed53c (diff)
downloadmruby-777cf70cc52e52dcce41585db5b19e997b40e65c.tar.gz
mruby-777cf70cc52e52dcce41585db5b19e997b40e65c.zip
Include reason in test failure message
I am seeing this test fail in some environments but can't determine why. The extra information will help me determine the reason bind(2) is failing.
Diffstat (limited to 'test/mruby_io_test.c')
-rw-r--r--test/mruby_io_test.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/mruby_io_test.c b/test/mruby_io_test.c
index 2777e605e..fdd20d226 100644
--- a/test/mruby_io_test.c
+++ b/test/mruby_io_test.c
@@ -1,4 +1,5 @@
#include <sys/types.h>
+#include <errno.h>
#if defined(_WIN32) || defined(_WIN64)
#include <winsock.h>
@@ -84,7 +85,9 @@ mrb_io_test_io_setup(mrb_state *mrb, mrb_value self)
sun0.sun_family = AF_UNIX;
snprintf(sun0.sun_path, sizeof(sun0.sun_path), "%s", socketname);
if (bind(fd3, (struct sockaddr *)&sun0, sizeof(sun0)) == -1) {
- mrb_raise(mrb, E_RUNTIME_ERROR, "can't make a socket bi");
+ mrb_raisef(mrb, E_RUNTIME_ERROR, "can't bind AF_UNIX socket to %S: %S",
+ mrb_str_new_cstr(mrb, sun0.sun_path),
+ mrb_fixnum_value(errno));
}
close(fd3);
#endif