Lines Matching refs:fd1
27 int fd1 = open("::alpha/bravo/charlie/delta/echo/foxtrot", O_RDWR | O_CREAT, 0644); in test_basic() local
28 ASSERT_GT(fd1, 0, ""); in test_basic()
31 ASSERT_EQ(write(fd1, "Hello, World!\n", 14), 14, ""); in test_basic()
32 ASSERT_EQ(close(fd1), 0, ""); in test_basic()
38 fd1 = open("::alpha/bravo/charlie/delta/echo/foxtrot", O_RDONLY | O_PIPELINE, 0644); in test_basic()
39 ASSERT_GT(fd1, 0, ""); in test_basic()
41 ASSERT_EQ(read(fd1, tmp, 14), 14, ""); in test_basic()
42 ASSERT_EQ(close(fd1), 0, ""); in test_basic()
45 fd1 = open("::alpha/banana", O_RDONLY | O_PIPELINE, 0644); in test_basic()
46 ASSERT_GT(fd1, 0, ""); in test_basic()
47 ASSERT_EQ(read(fd1, tmp, 14), -1, ""); in test_basic()
48 ASSERT_EQ(close(fd1), -1, ""); in test_basic()
50 fd1 = open("::file.txt", O_CREAT | O_RDWR, 0644); in test_basic()
51 ASSERT_GT(fd1, 0, ""); in test_basic()
52 ASSERT_EQ(close(fd1), 0, ""); in test_basic()
56 fd1 = open("::emptydir", O_RDONLY, 0644); in test_basic()
57 ASSERT_GT(fd1, 0, ""); in test_basic()
60 ASSERT_EQ(read(fd1, NULL, 0), 0, ""); in test_basic()
63 ASSERT_EQ(read(fd1, &buf, 1), -1, ""); in test_basic()
64 ASSERT_EQ(write(fd1, "Don't write to directories", 26), -1, ""); in test_basic()
65 ASSERT_EQ(ftruncate(fd1, 0), -1, ""); in test_basic()
68 ASSERT_EQ(close(fd1), 0, ""); in test_basic()