mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
Convert G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI and
2001-10-01 Alex Larsson <alexl@redhat.com> * glib/gconvert.[ch]: Convert G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI and G_CONVERT_ERROR_INVALID_URI to G_CONVERT_ERROR_BAD_URI. * tests/uri-test.c: Update tests
This commit is contained in:
committed by
Alexander Larsson
parent
ce83d7fb82
commit
5c75cc9617
@@ -103,14 +103,14 @@ from_uri_tests[] = {
|
||||
{ "file://otherhost/etc", "/etc", "otherhost"},
|
||||
{ "file://otherhost/etc/%23%25%20file", "/etc/#% file", "otherhost"},
|
||||
{ "file://%C3%B6%C3%A4%C3%A5/etc", "/etc", "öäå"},
|
||||
{ "file:////etc/%C3%B6%C3%C3%C3%A5", NULL, NULL, G_CONVERT_ERROR_INVALID_URI},
|
||||
{ "file://localhost/<2F><><EFBFBD>", NULL, NULL, G_CONVERT_ERROR_INVALID_URI},
|
||||
{ "file://<2F><><EFBFBD>/etc", NULL, NULL, G_CONVERT_ERROR_INVALID_URI},
|
||||
{ "file:///some/file#bad", NULL, NULL, G_CONVERT_ERROR_INVALID_URI},
|
||||
{ "file://some", NULL, NULL, G_CONVERT_ERROR_INVALID_URI},
|
||||
{ "", NULL, NULL, G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI}, /* should be G_CONVERT_ERROR_INVALID_URI */
|
||||
{ "file:test", NULL, NULL, G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI},
|
||||
{ "http://www.yahoo.com/", NULL, NULL, G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI},
|
||||
{ "file:////etc/%C3%B6%C3%C3%C3%A5", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
|
||||
{ "file://localhost/<2F><><EFBFBD>", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
|
||||
{ "file://<2F><><EFBFBD>/etc", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
|
||||
{ "file:///some/file#bad", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
|
||||
{ "file://some", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
|
||||
{ "", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
|
||||
{ "file:test", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
|
||||
{ "http://www.yahoo.com/", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
|
||||
{ "file:////etc", "/etc"}, /* should be "//etc" -- mistake in code for DOS results in dropped slash */
|
||||
{ "file://///etc", "//etc"}, /* should be "///etc" -- mistake in code for DOS results in dropped slash */
|
||||
{ "file:///c:\\foo", "/c:\\foo"}, /* should be "c:\\foo" on DOS perhaps, but that would be bad for Unix */
|
||||
@@ -125,7 +125,7 @@ from_uri_tests[] = {
|
||||
{ "file://%C3%80%C3%BF/", "/", "\xC3\x80\xC3\xBF"},
|
||||
{ "file://@/", "/", "@"},
|
||||
{ "file://:/", "/", ":"},
|
||||
{ "file://#/", NULL, NULL, G_CONVERT_ERROR_INVALID_URI},
|
||||
{ "file://#/", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
|
||||
{ "file://%23/", "/", "#"}, /* is it dangerous to return a hostname with a "#" character in it? */
|
||||
{ "file://%2F/", "/", "/"}, /* is it dangerous to return a hostname with a "/" character in it? */
|
||||
};
|
||||
|
Reference in New Issue
Block a user