summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2003-05-22 07:45:37 +0000
committerVladimir Glazounov <vg@openoffice.org>2003-05-22 07:45:37 +0000
commitb1743706aa6f71d1ba90ed27cb1e2ca9d855e73f (patch)
tree2362764f13ad433135302d53c3ed11cfa19224f3 /tools
parenta765bb0b417283459c23d539970056bff1726d03 (diff)
INTEGRATION: CWS uno4 (1.17.22); FILE MERGED
2003/05/07 15:42:17 kso 1.17.22.1: #i13760# - Added testcase for GetRelURL().
Diffstat (limited to 'tools')
-rw-r--r--tools/workben/urltest.cxx43
1 files changed, 41 insertions, 2 deletions
diff --git a/tools/workben/urltest.cxx b/tools/workben/urltest.cxx
index d603415605b6..cdb755e1adbc 100644
--- a/tools/workben/urltest.cxx
+++ b/tools/workben/urltest.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: urltest.cxx,v $
*
- * $Revision: 1.17 $
+ * $Revision: 1.18 $
*
- * last change: $Author: hr $ $Date: 2003-03-27 17:05:12 $
+ * last change: $Author: vg $ $Date: 2003-05-22 08:45:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1382,5 +1382,44 @@ main()
}
}
+ if (true)
+ {
+ // #i13760#
+
+ // Test for unrelated URLs.
+ const rtl::OUString aBaseURL(RTL_CONSTASCII_USTRINGPARAM(
+ "http://www.openoffice.org"));
+ rtl::OUString aRelURL (RTL_CONSTASCII_USTRINGPARAM(
+ "http://www.sun.com"));
+
+ rtl::OUString aRelURLToTest(
+ INetURLObject::GetRelURL(aBaseURL, aRelURL));
+
+ if (INetURLObject(aRelURLToTest) != INetURLObject(aRelURL))
+ printf("BAD GetRelURL(%s, %s), ret = %s\n",
+ ByteString(aBaseURL.getStr(),
+ RTL_TEXTENCODING_ASCII_US).GetBuffer(),
+ ByteString(aRelURL.getStr(),
+ RTL_TEXTENCODING_ASCII_US).GetBuffer(),
+ ByteString(aRelURLToTest.getStr(),
+ RTL_TEXTENCODING_ASCII_US).GetBuffer());
+
+ // Test for related URLs.
+ aRelURL = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "http://www.openoffice.org/api/test.html"));
+ aRelURLToTest = rtl::OUString(
+ INetURLObject::GetRelURL(aBaseURL, aRelURL));
+
+ if (!aRelURLToTest.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("api/test.html")))
+ printf("BAD GetRelURL(%s, %s), ret = %s\n",
+ ByteString(aBaseURL.getStr(),
+ RTL_TEXTENCODING_ASCII_US).GetBuffer(),
+ ByteString(aRelURL.getStr(),
+ RTL_TEXTENCODING_ASCII_US).GetBuffer(),
+ ByteString(aRelURLToTest.getStr(),
+ RTL_TEXTENCODING_ASCII_US).GetBuffer());
+ }
+
return bSuccess ? EXIT_SUCCESS : EXIT_FAILURE;
}