Lines Matching refs:buf
44 char* buf, size_t buf_size, int expected_errno) { in TestBasename() argument
46 int rc = basename_r(in, buf, buf_size); in TestBasename()
48 if (rc != -1 && buf != nullptr) { in TestBasename()
49 ASSERT_STREQ(expected_out, buf) << in; in TestBasename()
55 char* buf, size_t buf_size, int expected_errno) { in TestDirname() argument
57 int rc = dirname_r(in, buf, buf_size); in TestDirname()
59 if (rc != -1 && buf != nullptr) { in TestDirname()
60 ASSERT_STREQ(expected_out, buf) << in; in TestDirname()
68 char buf[256]; in TEST() local
70 TestBasename("", ".", -1, buf, 0, ERANGE); in TEST()
71 TestBasename("", ".", -1, buf, 1, ERANGE); in TEST()
72 TestBasename("", ".", 1, buf, 2, 0); in TEST()
73 TestBasename("", ".", 1, buf, sizeof(buf), 0); in TEST()
74 TestBasename("/usr/lib", "lib", 3, buf, sizeof(buf), 0); in TEST()
75 TestBasename("/usr/", "usr", 3, buf, sizeof(buf), 0); in TEST()
76 TestBasename("usr", "usr", 3, buf, sizeof(buf), 0); in TEST()
77 TestBasename("/", "/", 1, buf, sizeof(buf), 0); in TEST()
78 TestBasename(".", ".", 1, buf, sizeof(buf), 0); in TEST()
79 TestBasename("..", "..", 2, buf, sizeof(buf), 0); in TEST()
87 char buf[256]; in TEST() local
89 TestDirname("", ".", -1, buf, 0, ERANGE); in TEST()
90 TestDirname("", ".", -1, buf, 1, ERANGE); in TEST()
91 TestDirname("", ".", 1, buf, 2, 0); in TEST()
92 TestDirname("/usr/lib", "/usr", 4, buf, sizeof(buf), 0); in TEST()
93 TestDirname("/usr/", "/", 1, buf, sizeof(buf), 0); in TEST()
94 TestDirname("usr", ".", 1, buf, sizeof(buf), 0); in TEST()
95 TestDirname(".", ".", 1, buf, sizeof(buf), 0); in TEST()
96 TestDirname("..", ".", 1, buf, sizeof(buf), 0); in TEST()