1 // Copyright 2018 The Fuchsia Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include <string.h>
6 #include <lib/zxio/ops.h>
7 
8 #include <unittest/unittest.h>
9 
my_close(zxio_t * io)10 static zx_status_t my_close(zxio_t* io) {
11     return ZX_OK;
12 }
13 
ctx_test(void)14 bool ctx_test(void) {
15     BEGIN_TEST;
16 
17     zxio_ops_t ops;
18     memset(&ops, 0, sizeof(ops));
19     ops.close = my_close;
20 
21     zxio_t io = {};
22     zxio_init(&io, &ops);
23     ASSERT_EQ(ZX_OK, zxio_close(&io));
24 
25     END_TEST;
26 }
27 
28 BEGIN_TEST_CASE(zxio_test)
29 RUN_TEST(ctx_test);
30 END_TEST_CASE(zxio_test)
31