Lines Matching refs:fd

16 	long read, fd;  in ZTEST()  local
19 fd = semihost_open(test_file, SEMIHOST_OPEN_WB); in ZTEST()
20 zassert_true(fd > 0, "Bad handle (%d)", fd); in ZTEST()
21 zassert_equal(semihost_flen(fd), 0, "File not empty"); in ZTEST()
24 zassert_equal(semihost_write(fd, w_buffer, sizeof(w_buffer)), 0, "Write failed"); in ZTEST()
25 zassert_equal(semihost_flen(fd), sizeof(w_buffer), "Size not updated"); in ZTEST()
26 zassert_equal(semihost_write(fd, w_buffer, sizeof(w_buffer)), 0, "Write failed"); in ZTEST()
27 zassert_equal(semihost_flen(fd), 2 * sizeof(w_buffer), "Size not updated"); in ZTEST()
30 read = semihost_read(fd, r_buffer, sizeof(r_buffer)); in ZTEST()
34 zassert_equal(semihost_close(fd), 0, "Close failed"); in ZTEST()
37 fd = semihost_open(test_file, SEMIHOST_OPEN_RB); in ZTEST()
38 zassert_true(fd > 0, "Bad handle (%d)", fd); in ZTEST()
39 zassert_equal(semihost_flen(fd), 2 * sizeof(w_buffer), "Data not preserved"); in ZTEST()
42 read = semihost_read(fd, r_buffer, sizeof(r_buffer)); in ZTEST()
45 read = semihost_read(fd, r_buffer, sizeof(r_buffer)); in ZTEST()
50 read = semihost_read(fd, r_buffer, sizeof(r_buffer)); in ZTEST()
54 zassert_equal(semihost_seek(fd, 1), 0, "Seek failed"); in ZTEST()
57 read = semihost_read(fd, r_buffer, sizeof(r_buffer) - 1); in ZTEST()
62 zassert_equal(semihost_close(fd), 0, "Close failed"); in ZTEST()
65 fd = semihost_open(test_file, SEMIHOST_OPEN_WB); in ZTEST()
66 zassert_true(fd > 0, "Bad handle (%d)", fd); in ZTEST()
67 zassert_equal(semihost_flen(fd), 0, "File not empty"); in ZTEST()
68 zassert_equal(semihost_close(fd), 0, "Close failed"); in ZTEST()