summaryrefslogtreecommitdiff
path: root/lib9p/tests
diff options
context:
space:
mode:
Diffstat (limited to 'lib9p/tests')
-rw-r--r--lib9p/tests/client_config/config.h1
-rw-r--r--lib9p/tests/test_compile_config/config.h2
-rw-r--r--lib9p/tests/test_server/config/config.h3
-rw-r--r--lib9p/tests/test_server/fs_flush.c6
-rw-r--r--lib9p/tests/test_server/fs_shutdown.c4
-rw-r--r--lib9p/tests/test_server/fs_whoami.c7
-rw-r--r--lib9p/tests/testclient-hangup.c4
-rw-r--r--lib9p/tests/testclient-sess.c4
8 files changed, 14 insertions, 17 deletions
diff --git a/lib9p/tests/client_config/config.h b/lib9p/tests/client_config/config.h
index bcf030d..4bba4ec 100644
--- a/lib9p/tests/client_config/config.h
+++ b/lib9p/tests/client_config/config.h
@@ -7,7 +7,6 @@
#ifndef _CONFIG_H_
#define _CONFIG_H_
-#define CONFIG_9P_MAX_ERR_SIZE 128
#define CONFIG_9P_MAX_9P2000_e_WELEM 16
#define CONFIG_9P_ENABLE_9P2000 1 /* bool */
diff --git a/lib9p/tests/test_compile_config/config.h b/lib9p/tests/test_compile_config/config.h
index 02cb8e5..cb3709e 100644
--- a/lib9p/tests/test_compile_config/config.h
+++ b/lib9p/tests/test_compile_config/config.h
@@ -9,11 +9,11 @@
/* 9P *************************************************************************/
-#define CONFIG_9P_MAX_ERR_SIZE 128
#define CONFIG_9P_MAX_9P2000_e_WELEM 16
/* 9P_SRV *********************************************************************/
+#define CONFIG_9P_SRV_MAX_ERR_SIZE 128
#define CONFIG_9P_SRV_MAX_MSG_SIZE ((4*1024)+24)
#define CONFIG_9P_SRV_MAX_HOSTMSG_SIZE CONFIG_9P_SRV_MAX_MSG_SIZE+16
diff --git a/lib9p/tests/test_server/config/config.h b/lib9p/tests/test_server/config/config.h
index f49894b..a657f60 100644
--- a/lib9p/tests/test_server/config/config.h
+++ b/lib9p/tests/test_server/config/config.h
@@ -12,8 +12,6 @@
/* 9P *************************************************************************/
-#define CONFIG_9P_MAX_ERR_SIZE 128 /* 128 is what Plan 9 4e uses */
-
#define CONFIG_9P_ENABLE_9P2000 1 /* bool */
#define CONFIG_9P_ENABLE_9P2000_u 1 /* bool */
#define CONFIG_9P_ENABLE_9P2000_e 0 /* bool */
@@ -42,6 +40,7 @@
* (8*1024)+160 in 2e and 3e.
*/
#define CONFIG_9P_SRV_MAX_MSG_SIZE ((4*1024)+24)
+#define CONFIG_9P_SRV_MAX_ERR_SIZE 128 /* 128 is what Plan 9 4e uses */
/**
* Maximum host-data-structure size. A message may be larger in
* unmarshaled-host-structures than marshaled-net-bytes due to (1)
diff --git a/lib9p/tests/test_server/fs_flush.c b/lib9p/tests/test_server/fs_flush.c
index 6b677ea..eef9891 100644
--- a/lib9p/tests/test_server/fs_flush.c
+++ b/lib9p/tests/test_server/fs_flush.c
@@ -50,12 +50,12 @@ static struct lib9p_srv_stat flush_file_stat(struct flush_file *self, struct lib
static void flush_file_wstat(struct flush_file *self, struct lib9p_srv_ctx *ctx, struct lib9p_srv_stat) {
assert(self);
assert(ctx);
- lib9p_error(&ctx->basectx, E_POSIX_EROFS, "cannot wstat API file");
+ lib9p_error(ctx, E_POSIX_EROFS, "cannot wstat API file");
}
static void flush_file_remove(struct flush_file *self, struct lib9p_srv_ctx *ctx) {
assert(self);
assert(ctx);
- lib9p_error(&ctx->basectx, E_POSIX_EROFS, "cannot remove API file");
+ lib9p_error(ctx, E_POSIX_EROFS, "cannot remove API file");
}
LIB9P_SRV_NOTDIR(struct flush_file, flush_file)
@@ -121,7 +121,7 @@ static void flush_fio_pread(struct flush_fio *self, struct lib9p_srv_ctx *ctx,
break;
case FLUSH_ERROR:
lib9p_srv_acknowledge_flush(ctx);
- lib9p_error(&ctx->basectx, E_POSIX_ECANCELED, "request canceled by flush");
+ lib9p_error(ctx, E_POSIX_ECANCELED, "request canceled by flush");
break;
case FLUSH_SILENT:
lib9p_srv_acknowledge_flush(ctx);
diff --git a/lib9p/tests/test_server/fs_shutdown.c b/lib9p/tests/test_server/fs_shutdown.c
index 11a941f..5b3bc71 100644
--- a/lib9p/tests/test_server/fs_shutdown.c
+++ b/lib9p/tests/test_server/fs_shutdown.c
@@ -49,12 +49,12 @@ static struct lib9p_srv_stat shutdown_file_stat(struct shutdown_file *self, stru
static void shutdown_file_wstat(struct shutdown_file *self, struct lib9p_srv_ctx *ctx, struct lib9p_srv_stat) {
assert(self);
assert(ctx);
- lib9p_error(&ctx->basectx, E_POSIX_EROFS, "cannot wstat API file");
+ lib9p_error(ctx, E_POSIX_EROFS, "cannot wstat API file");
}
static void shutdown_file_remove(struct shutdown_file *self, struct lib9p_srv_ctx *ctx) {
assert(self);
assert(ctx);
- lib9p_error(&ctx->basectx, E_POSIX_EROFS, "cannot remove API file");
+ lib9p_error(ctx, E_POSIX_EROFS, "cannot remove API file");
}
LIB9P_SRV_NOTDIR(struct shutdown_file, shutdown_file)
diff --git a/lib9p/tests/test_server/fs_whoami.c b/lib9p/tests/test_server/fs_whoami.c
index 273d659..14dd0ba 100644
--- a/lib9p/tests/test_server/fs_whoami.c
+++ b/lib9p/tests/test_server/fs_whoami.c
@@ -73,12 +73,12 @@ static struct lib9p_srv_stat whoami_file_stat(struct whoami_file *self, struct l
static void whoami_file_wstat(struct whoami_file *self, struct lib9p_srv_ctx *ctx, struct lib9p_srv_stat) {
assert(self);
assert(ctx);
- lib9p_error(&ctx->basectx, E_POSIX_EROFS, "cannot wstat API file");
+ lib9p_error(ctx, E_POSIX_EROFS, "cannot wstat API file");
}
static void whoami_file_remove(struct whoami_file *self, struct lib9p_srv_ctx *ctx) {
assert(self);
assert(ctx);
- lib9p_error(&ctx->basectx, E_POSIX_EROFS, "cannot remove API file");
+ lib9p_error(ctx, E_POSIX_EROFS, "cannot remove API file");
}
LIB9P_SRV_NOTDIR(struct whoami_file, whoami_file)
@@ -137,8 +137,7 @@ static void whoami_fio_pread(struct whoami_fio *self, struct lib9p_srv_ctx *ctx,
ctx->user->num, ctx->user->name.len, ctx->user->name.utf8);
if (byte_offset > (uint64_t)data_size) {
- lib9p_error(&ctx->basectx,
- E_POSIX_EINVAL, "offset is past end-of-file length");
+ lib9p_error(ctx, E_POSIX_EINVAL, "offset is past end-of-file length");
return;
}
diff --git a/lib9p/tests/testclient-hangup.c b/lib9p/tests/testclient-hangup.c
index a819e80..2efb49a 100644
--- a/lib9p/tests/testclient-hangup.c
+++ b/lib9p/tests/testclient-hangup.c
@@ -24,8 +24,8 @@
static void _send9p(int fd, struct lib9p_ctx *ctx, enum lib9p_msg_type typ, void *body) {
struct lib9p_Tmsg_send_buf buf;
- bool err = lib9p_Tmsg_marshal(ctx, typ, body, &buf);
- assert(!err);
+ error err = lib9p_Tmsg_marshal(ctx, typ, body, &buf);
+ assert(ERROR_IS_NULL(err));
size_t exp = 0;
for (size_t i = 0; i < buf.iov_cnt; i++)
exp += buf.iov[i].iov_len;
diff --git a/lib9p/tests/testclient-sess.c b/lib9p/tests/testclient-sess.c
index d466eea..0cec6c6 100644
--- a/lib9p/tests/testclient-sess.c
+++ b/lib9p/tests/testclient-sess.c
@@ -24,8 +24,8 @@
static void _send9p(int fd, struct lib9p_ctx *ctx, enum lib9p_msg_type typ, void *body) {
struct lib9p_Tmsg_send_buf buf;
- bool err = lib9p_Tmsg_marshal(ctx, typ, body, &buf);
- assert(!err);
+ error err = lib9p_Tmsg_marshal(ctx, typ, body, &buf);
+ assert(ERROR_IS_NULL(err));
size_t exp = 0;
for (size_t i = 0; i < buf.iov_cnt; i++)
exp += buf.iov[i].iov_len;