summaryrefslogtreecommitdiff
path: root/libmisc/tests/test_obj_autobox.c
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-06-09 21:35:30 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-06-09 21:35:30 -0600
commitcd5768ef4bc36b33699539d9656f455bafb0de0c (patch)
tree55aa107d229e85d5b7eb611b7124eaf150d3a3bd /libmisc/tests/test_obj_autobox.c
parentef5956962675d7cb1bdb76a2fc45760b002a570c (diff)
parentba860d699f4e5bfe8cd19b140044bbbd2f78919a (diff)
Merge branch 'lukeshu/misc'
Diffstat (limited to 'libmisc/tests/test_obj_autobox.c')
-rw-r--r--libmisc/tests/test_obj_autobox.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libmisc/tests/test_obj_autobox.c b/libmisc/tests/test_obj_autobox.c
index 1bf442d..1110639 100644
--- a/libmisc/tests/test_obj_autobox.c
+++ b/libmisc/tests/test_obj_autobox.c
@@ -14,11 +14,11 @@
/* interfaces *****************************************************************/
#define reader_LO_IFACE \
- LO_FUNC(ssize_t, read, void *, size_t)
+ LO_FUNC(size_t, read, void *, size_t)
LO_INTERFACE(reader);
#define writer_LO_IFACE \
- LO_FUNC(ssize_t, write, void *, size_t)
+ LO_FUNC(size_t, write, void *, size_t)
LO_INTERFACE(writer);
#define read_writer_LO_IFACE \
@@ -42,7 +42,7 @@ LO_IMPLEMENTATION_C(reader, struct myclass, myclass, static);
LO_IMPLEMENTATION_C(writer, struct myclass, myclass, static);
LO_IMPLEMENTATION_C(read_writer, struct myclass, myclass, static);
-static ssize_t myclass_read(struct myclass *self, void *buf, size_t count) {
+static size_t myclass_read(struct myclass *self, void *buf, size_t count) {
test_assert(self);
if (count > self->len)
count = self->len;
@@ -50,10 +50,10 @@ static ssize_t myclass_read(struct myclass *self, void *buf, size_t count) {
return count;
}
-static ssize_t myclass_write(struct myclass *self, void *buf, size_t count) {
+static size_t myclass_write(struct myclass *self, void *buf, size_t count) {
test_assert(self);
if (self->len)
- return -1;
+ return 0;
if (count > sizeof(self->buf))
count = sizeof(self->buf);
memcpy(self->buf, buf, count);