From 777cf70cc52e52dcce41585db5b19e997b40e65c Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Thu, 12 May 2016 16:02:09 -0700 Subject: 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. --- test/mruby_io_test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test') 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 +#include #if defined(_WIN32) || defined(_WIN64) #include @@ -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 -- cgit v1.2.3