diff options
author | Stephan Bergmann <sb@openoffice.org> | 2002-08-28 13:44:03 +0000 |
---|---|---|
committer | Stephan Bergmann <sb@openoffice.org> | 2002-08-28 13:44:03 +0000 |
commit | fb33ddb560d2e59ec0d1e1be18bb85d9901add32 (patch) | |
tree | f208fcfea79382c39df3d25d123cc55fbfb213ea /tools/workben | |
parent | 0ced9d52a90db161e7e7f72684099f443e1975f5 (diff) |
#100421# Accept NetBIOS names as host names in file URLs.
Diffstat (limited to 'tools/workben')
-rw-r--r-- | tools/workben/urltest.cxx | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/tools/workben/urltest.cxx b/tools/workben/urltest.cxx index 12f2d1922853..4889771a2b92 100644 --- a/tools/workben/urltest.cxx +++ b/tools/workben/urltest.cxx @@ -2,9 +2,9 @@ * * $RCSfile: urltest.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: oj $ $Date: 2002-01-15 09:36:14 $ + * last change: $Author: sb $ $Date: 2002-08-28 14:44:03 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1123,5 +1123,36 @@ main() } } + if (true) + { + struct Test + { + char const * m_pInput; + char const * m_pOutput; + }; + static Test const aTest[] + = { { "file:///abc", "file:///abc" }, + { "file://localhost/abc", "file:///abc" }, + { "file://LocalHost/abc", "file:///abc" }, + { "file://LOCALHOST/abc", "file:///abc" }, + { "file://127.0.0.1/abc", "file://127.0.0.1/abc" }, + { "file://xxx.yyy-zzz/abc", "file://xxx.yyy-zzz/abc" }, + { "file://xxx_yyy/abc", "file://xxx_yyy/abc" }, + { "file://!%23$%&'()-.@^_{}~/abc", + "file://!%23$%25&'()-.@%5E_%7B%7D~/abc" } }; + for (int i = 0; i < sizeof aTest / sizeof aTest[0]; ++i) + { + INetURLObject aUrl(aTest[i].m_pInput); + if (aUrl.HasError() != (aTest[i].m_pOutput == 0) + || aUrl.GetMainURL().CompareToAscii(aTest[i].m_pOutput) != 0) + printf("BAD %s -> %s != %s\n", + aTest[i].m_pInput, + aUrl.HasError() ? "<none>" + : ByteString(aUrl.GetMainURL(), + RTL_TEXTENCODING_ASCII_US).GetBuffer(), + aTest[i].m_pOutput == 0 ? "<none>" : aTest[i].m_pOutput); + } + } + return bSuccess ? EXIT_SUCCESS : EXIT_FAILURE; } |