diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-06-08 04:02:52 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-06-08 04:02:52 -0600 |
commit | ef5956962675d7cb1bdb76a2fc45760b002a570c (patch) | |
tree | 54fa10580413b4b1dfbd9b22a52fffca834f772e /libmisc/tests/test_obj_nest.c | |
parent | 53d0b11262177cd212803fc9330e055871c348b3 (diff) | |
parent | db1b4b4cc41c84ec4c8e11418431a1ab2a1001c5 (diff) |
Merge branch 'lukeshu/fix-obj-box'
Diffstat (limited to 'libmisc/tests/test_obj_nest.c')
-rw-r--r-- | libmisc/tests/test_obj_nest.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libmisc/tests/test_obj_nest.c b/libmisc/tests/test_obj_nest.c index ba5ac37..66c1efd 100644 --- a/libmisc/tests/test_obj_nest.c +++ b/libmisc/tests/test_obj_nest.c @@ -64,10 +64,19 @@ static ssize_t myclass_write(struct myclass *self, void *buf, size_t count) { int main() { struct myclass _obj = {}; - lo_interface read_writer obj = LO_BOX(read_writer, &_obj); + lo_interface read_writer obj = lo_box_myclass_as_read_writer(&_obj); test_assert(LO_CALL(obj, write, "Hello", 6) == 6); char buf[6] = {}; test_assert(LO_CALL(obj, read, buf, 3) == 3); test_assert(memcmp(buf, "Hel\0\0\0", 6) == 0); + + lo_interface reader rd = lo_box_myclass_as_reader(&_obj); + rd = lo_box_read_writer_as_reader(obj); + (void) rd; + + lo_interface writer wr = lo_box_myclass_as_writer(&_obj); + wr = lo_box_read_writer_as_writer(obj); + (void) wr; + return 0; } |