Skip to content
Snippets Groups Projects
Commit 978b5faa authored by Simon McVittie's avatar Simon McVittie
Browse files

tests: Exercise trailing slash in _srt_resolve_in_sysroot


"foo/bar/" is meant to be exactly equivalent to "foo/bar/.", and almost
equivalent to "foo/bar" (with the important difference that it fails
if bar is a non-directory).

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent af4c1d7c
Branches
Tags
1 merge request!313Fix listing overrides in system-info with recent pressure-vessel
......@@ -128,11 +128,12 @@ test_resolve_in_sysroot (Fixture *f,
static const ResolveTest tests[] =
{
{ { "a/b/c/d" }, { "a/b/c/d" } },
{ { "a/b/c/d/" }, { "a/b/c/d" } },
{
{ "a/b/c/d", SRT_RESOLVE_FLAGS_NONE, RESOLVE_CALL_FLAGS_IGNORE_PATH },
{ "a/b/c/d" },
},
{ { "a/b/c/d", SRT_RESOLVE_FLAGS_MKDIR_P }, { "a/b/c/d" } },
{ { "a/b/c/d/", SRT_RESOLVE_FLAGS_MKDIR_P }, { "a/b/c/d" } },
{
{ "a/b/c/d", SRT_RESOLVE_FLAGS_MKDIR_P, RESOLVE_CALL_FLAGS_IGNORE_PATH },
{ "a/b/c/d" },
......@@ -150,10 +151,19 @@ test_resolve_in_sysroot (Fixture *f,
{ "a/b/c/d" }
},
{ { "a/b/c/file", SRT_RESOLVE_FLAGS_READABLE }, { "a/b/c/file" } },
{ { "a/b/c/file/" }, { NULL, G_IO_ERROR_NOT_DIRECTORY }},
{
{ "a/b/c/file", SRT_RESOLVE_FLAGS_DIRECTORY },
{ NULL, G_IO_ERROR_NOT_DIRECTORY }
},
{
{ "a/b/c/file/", SRT_RESOLVE_FLAGS_DIRECTORY },
{ NULL, G_IO_ERROR_NOT_DIRECTORY }
},
{
{ "a/b/c/file/", SRT_RESOLVE_FLAGS_READABLE },
{ NULL, G_IO_ERROR_NOT_DIRECTORY }
},
{
{ "a/b/c/file", SRT_RESOLVE_FLAGS_READABLE|SRT_RESOLVE_FLAGS_DIRECTORY },
{ NULL, G_IO_ERROR_NOT_DIRECTORY }
......@@ -161,8 +171,9 @@ test_resolve_in_sysroot (Fixture *f,
{ { "a/b///////.////./././///././c/d" }, { "a/b/c/d" } },
{ { "/a/b///////.////././../b2////././c2/d2" }, { "a/b2/c2/d2" } },
{ { "a/b/c/d/e/f" }, { NULL, G_IO_ERROR_NOT_FOUND } },
{ { "a/b/c/d/e/f/", SRT_RESOLVE_FLAGS_MKDIR_P }, { "a/b/c/d/e/f" } },
{ { "a/b/c/d/e/f", SRT_RESOLVE_FLAGS_MKDIR_P }, { "a/b/c/d/e/f" } },
{ { "a/b/c/d/e/f" }, { "a/b/c/d/e/f" } },
{ { "a/b/c/d/e/f/" }, { "a/b/c/d/e/f" } },
{ { "a/b/c/d/e/f", SRT_RESOLVE_FLAGS_MKDIR_P }, { "a/b/c/d/e/f" } },
{ { "a3/b3/c3" }, { NULL, G_IO_ERROR_NOT_FOUND } },
{ { "a3/b3/c3", SRT_RESOLVE_FLAGS_MKDIR_P }, { "a3/b3/c3" } },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment