<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[206378] trunk/Tools</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/206378">206378</a></dd>
<dt>Author</dt> <dd>utatane.tea@gmail.com</dd>
<dt>Date</dt> <dd>2016-09-26 10:07:38 -0700 (Mon, 26 Sep 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Using char16_t instead of wchar_t in TestWebKitAPI URLParser tests
https://bugs.webkit.org/show_bug.cgi?id=162537
Reviewed by Alex Christensen.
Some build bot (Linux ARM GTK port) fails since we cannot select
the specific StringBuilder::append method for wchar_t.
wchar_t implementation highly depends on platforms. sizeof(wchar_t) == 2
in Windows, while sizeof(wchar_t) == 4 in Linux and OS X. So, ICU
uses wchar_t for UChar (UTF-16) in Windows while it doesn't in other
platforms.
StringBuilder::append is overloaded for UChar. In Windows, we can pass
wchar_t since UChar is wchar_t. However, we cannot do that in other platforms.
Instead of using wchar_t, we use more platform portable UTF-16 literal for
testing. Use char16_t and C++11 UTF-16 literal.
* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::utf16String):
(TestWebKitAPI::TEST_F):
(TestWebKitAPI::wideString): Deleted.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebCoreURLParsercpp">trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (206377 => 206378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-09-26 16:40:38 UTC (rev 206377)
+++ trunk/Tools/ChangeLog        2016-09-26 17:07:38 UTC (rev 206378)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2016-09-26 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ Using char16_t instead of wchar_t in TestWebKitAPI URLParser tests
+ https://bugs.webkit.org/show_bug.cgi?id=162537
+
+ Reviewed by Alex Christensen.
+
+ Some build bot (Linux ARM GTK port) fails since we cannot select
+ the specific StringBuilder::append method for wchar_t.
+
+ wchar_t implementation highly depends on platforms. sizeof(wchar_t) == 2
+ in Windows, while sizeof(wchar_t) == 4 in Linux and OS X. So, ICU
+ uses wchar_t for UChar (UTF-16) in Windows while it doesn't in other
+ platforms.
+
+ StringBuilder::append is overloaded for UChar. In Windows, we can pass
+ wchar_t since UChar is wchar_t. However, we cannot do that in other platforms.
+
+ Instead of using wchar_t, we use more platform portable UTF-16 literal for
+ testing. Use char16_t and C++11 UTF-16 literal.
+
+ * TestWebKitAPI/Tests/WebCore/URLParser.cpp:
+ (TestWebKitAPI::utf16String):
+ (TestWebKitAPI::TEST_F):
+ (TestWebKitAPI::wideString): Deleted.
+
</ins><span class="cx"> 2016-09-25 Gyuyoung Kim <gyuyoung.kim@webkit.org>
</span><span class="cx">
</span><span class="cx"> [EFL] Adjust EFL indentation to EFL MiniBrowser
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCoreURLParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp (206377 => 206378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp        2016-09-26 16:40:38 UTC (rev 206377)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp        2016-09-26 17:07:38 UTC (rev 206378)
</span><span class="lines">@@ -92,12 +92,12 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template<size_t length>
</span><del>-static String wideString(const wchar_t (&url)[length])
</del><ins>+static String utf16String(const char16_t (&url)[length])
</ins><span class="cx"> {
</span><span class="cx"> StringBuilder builder;
</span><span class="cx"> builder.reserveCapacity(length - 1);
</span><span class="cx"> for (size_t i = 0; i < length - 1; ++i)
</span><del>- builder.append(url[i]);
</del><ins>+ builder.append(static_cast<UChar>(url[i]));
</ins><span class="cx"> return builder.toString();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -270,12 +270,12 @@
</span><span class="cx"> checkRelativeURL("//whatwg.org/index.html", "https://www.webkit.org/path", {"https", "", "", "whatwg.org", 0, "/index.html", "", "", "https://whatwg.org/index.html"});
</span><span class="cx"> checkRelativeURL("http://example\t.\norg", "http://example.org/foo/bar", {"http", "", "", "example.org", 0, "/", "", "", "http://example.org/"});
</span><span class="cx"> checkRelativeURL("test", "file:///path1/path2", {"file", "", "", "", 0, "/path1/test", "", "", "file:///path1/test"});
</span><del>- checkRelativeURL(wideString(L"http://www.foo。bar.com"), "http://other.com/", {"http", "", "", "www.foo.bar.com", 0, "/", "", "", "http://www.foo.bar.com/"});
- checkRelativeURL(wideString(L"sc://ñ.test/"), "about:blank", {"sc", "", "", "xn--ida.test", 0, "/", "", "", "sc://xn--ida.test/"});
</del><ins>+ checkRelativeURL(utf16String(u"http://www.foo。bar.com"), "http://other.com/", {"http", "", "", "www.foo.bar.com", 0, "/", "", "", "http://www.foo.bar.com/"});
+ checkRelativeURL(utf16String(u"sc://ñ.test/"), "about:blank", {"sc", "", "", "xn--ida.test", 0, "/", "", "", "sc://xn--ida.test/"});
</ins><span class="cx"> checkRelativeURL("#fragment", "http://host/path", {"http", "", "", "host", 0, "/path", "", "fragment", "http://host/path#fragment"});
</span><span class="cx"> checkRelativeURL("?query", "http://host/path", {"http", "", "", "host", 0, "/path", "query", "", "http://host/path?query"});
</span><span class="cx"> checkRelativeURL("?query#fragment", "http://host/path", {"http", "", "", "host", 0, "/path", "query", "fragment", "http://host/path?query#fragment"});
</span><del>- checkRelativeURL(wideString(L"?β"), "http://example.org/foo/bar", {"http", "", "", "example.org", 0, "/foo/bar", "%CE%B2", "", "http://example.org/foo/bar?%CE%B2"});
</del><ins>+ checkRelativeURL(utf16String(u"?β"), "http://example.org/foo/bar", {"http", "", "", "example.org", 0, "/foo/bar", "%CE%B2", "", "http://example.org/foo/bar?%CE%B2"});
</ins><span class="cx"> checkRelativeURL("?", "http://example.org/foo/bar", {"http", "", "", "example.org", 0, "/foo/bar", "", "", "http://example.org/foo/bar?"});
</span><span class="cx"> checkRelativeURL("#", "http://example.org/foo/bar", {"http", "", "", "example.org", 0, "/foo/bar", "", "", "http://example.org/foo/bar#"});
</span><span class="cx"> checkRelativeURL("?#", "http://example.org/foo/bar", {"http", "", "", "example.org", 0, "/foo/bar", "", "", "http://example.org/foo/bar?#"});
</span><span class="lines">@@ -451,8 +451,8 @@
</span><span class="cx"> checkURLDifferences("file://[0:a:0:0:b:c:0:0]/path",
</span><span class="cx"> {"file", "", "", "[0:a::b:c:0:0]", 0, "/path", "", "", "file://[0:a::b:c:0:0]/path"},
</span><span class="cx"> {"file", "", "", "[0:a:0:0:b:c:0:0]", 0, "/path", "", "", "file://[0:a:0:0:b:c:0:0]/path"});
</span><del>- checkRelativeURLDifferences(wideString(L"#β"), "http://example.org/foo/bar",
- {"http", "", "", "example.org", 0, "/foo/bar", "", wideString(L"β"), wideString(L"http://example.org/foo/bar#β")},
</del><ins>+ checkRelativeURLDifferences(utf16String(u"#β"), "http://example.org/foo/bar",
+ {"http", "", "", "example.org", 0, "/foo/bar", "", utf16String(u"β"), utf16String(u"http://example.org/foo/bar#β")},
</ins><span class="cx"> {"http", "", "", "example.org", 0, "/foo/bar", "", "%CE%B2", "http://example.org/foo/bar#%CE%B2"});
</span><span class="cx"> checkURLDifferences("http://",
</span><span class="cx"> {"", "", "", "", 0, "", "", "", "http://"},
</span><span class="lines">@@ -532,7 +532,7 @@
</span><span class="cx"> {"http", "", "", "host%73", 0, "/", "", "", "http://host%73/"});
</span><span class="cx">
</span><span class="cx"> // URLParser matches Chrome and the spec, but not URL::parse or Firefox.
</span><del>- checkURLDifferences(wideString(L"http://0Xc0.0250.01"),
</del><ins>+ checkURLDifferences(utf16String(u"http://0Xc0.0250.01"),
</ins><span class="cx"> {"http", "", "", "192.168.0.1", 0, "/", "", "", "http://192.168.0.1/"},
</span><span class="cx"> {"http", "", "", "0xc0.0250.01", 0, "/", "", "", "http://0xc0.0250.01/"});
</span><span class="cx"> checkURLDifferences("http://host/path%2e.%2E",
</span><span class="lines">@@ -539,9 +539,9 @@
</span><span class="cx"> {"http", "", "", "host", 0, "/path...", "", "", "http://host/path..."},
</span><span class="cx"> {"http", "", "", "host", 0, "/path%2e.%2E", "", "", "http://host/path%2e.%2E"});
</span><span class="cx">
</span><del>- checkRelativeURLDifferences(wideString(L"http://foo:💩@example.com/bar"), "http://other.com/",
- {"http", "foo", wideString(L"💩"), "example.com", 0, "/bar", "", "", "http://foo:%F0%9F%92%A9@example.com/bar"},
- {"", "", "", "", 0, "", "", "", wideString(L"http://foo:💩@example.com/bar")});
</del><ins>+ checkRelativeURLDifferences(utf16String(u"http://foo:💩@example.com/bar"), "http://other.com/",
+ {"http", "foo", utf16String(u"💩"), "example.com", 0, "/bar", "", "", "http://foo:%F0%9F%92%A9@example.com/bar"},
+ {"", "", "", "", 0, "", "", "", utf16String(u"http://foo:💩@example.com/bar")});
</ins><span class="cx"> checkRelativeURLDifferences("http://&a:foo(b]c@d:2/", "http://example.org/foo/bar",
</span><span class="cx"> {"http", "&a", "foo(b]c", "d", 2, "/", "", "", "http://&a:foo(b%5Dc@d:2/"},
</span><span class="cx"> {"", "", "", "", 0, "", "", "", "http://&a:foo(b]c@d:2/"});
</span><span class="lines">@@ -584,11 +584,11 @@
</span><span class="cx"> checkRelativeURLDifferences("foo://", "http://example.org/foo/bar",
</span><span class="cx"> {"foo", "", "", "", 0, "/", "", "", "foo:///"},
</span><span class="cx"> {"foo", "", "", "", 0, "//", "", "", "foo://"});
</span><del>- checkURLDifferences(wideString(L"http://host?ß😍#ß😍"),
- {"http", "", "", "host", 0, "/", "%C3%9F%F0%9F%98%8D", wideString(L"ß😍"), wideString(L"http://host/?%C3%9F%F0%9F%98%8D#ß😍")},
</del><ins>+ checkURLDifferences(utf16String(u"http://host?ß😍#ß😍"),
+ {"http", "", "", "host", 0, "/", "%C3%9F%F0%9F%98%8D", utf16String(u"ß😍"), utf16String(u"http://host/?%C3%9F%F0%9F%98%8D#ß😍")},
</ins><span class="cx"> {"http", "", "", "host", 0, "/", "%C3%9F%F0%9F%98%8D", "%C3%9F%F0%9F%98%8D", "http://host/?%C3%9F%F0%9F%98%8D#%C3%9F%F0%9F%98%8D"});
</span><del>- checkURLDifferences(wideString(L"http://host/path#💩\t💩"),
- {"http", "", "", "host", 0, "/path", "", wideString(L"💩💩"), wideString(L"http://host/path#💩💩")},
</del><ins>+ checkURLDifferences(utf16String(u"http://host/path#💩\t💩"),
+ {"http", "", "", "host", 0, "/path", "", utf16String(u"💩💩"), utf16String(u"http://host/path#💩💩")},
</ins><span class="cx"> {"http", "", "", "host", 0, "/path", "", "%F0%9F%92%A9%F0%9F%92%A9", "http://host/path#%F0%9F%92%A9%F0%9F%92%A9"});
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -742,23 +742,23 @@
</span><span class="cx"> const wchar_t surrogateBegin = 0xD800;
</span><span class="cx"> const wchar_t validSurrogateEnd = 0xDD55;
</span><span class="cx"> const wchar_t invalidSurrogateEnd = 'A';
</span><del>- checkURL(wideString<12>({'h', 't', 't', 'p', ':', '/', '/', 'w', '/', surrogateBegin, validSurrogateEnd, '\0'}),
</del><ins>+ checkURL(utf16String<12>({'h', 't', 't', 'p', ':', '/', '/', 'w', '/', surrogateBegin, validSurrogateEnd, '\0'}),
</ins><span class="cx"> {"http", "", "", "w", 0, "/%F0%90%85%95", "", "", "http://w/%F0%90%85%95"});
</span><span class="cx">
</span><span class="cx"> // URLParser matches Chrome and Firefox but not URL::parse.
</span><del>- checkURLDifferences(wideString<12>({'h', 't', 't', 'p', ':', '/', '/', 'w', '/', surrogateBegin, invalidSurrogateEnd}),
</del><ins>+ checkURLDifferences(utf16String<12>({'h', 't', 't', 'p', ':', '/', '/', 'w', '/', surrogateBegin, invalidSurrogateEnd}),
</ins><span class="cx"> {"http", "", "", "w", 0, "/%EF%BF%BDA", "", "", "http://w/%EF%BF%BDA"},
</span><span class="cx"> {"http", "", "", "w", 0, "/%ED%A0%80A", "", "", "http://w/%ED%A0%80A"});
</span><del>- checkURLDifferences(wideString<13>({'h', 't', 't', 'p', ':', '/', '/', 'w', '/', '?', surrogateBegin, invalidSurrogateEnd, '\0'}),
</del><ins>+ checkURLDifferences(utf16String<13>({'h', 't', 't', 'p', ':', '/', '/', 'w', '/', '?', surrogateBegin, invalidSurrogateEnd, '\0'}),
</ins><span class="cx"> {"http", "", "", "w", 0, "/", "%EF%BF%BDA", "", "http://w/?%EF%BF%BDA"},
</span><span class="cx"> {"http", "", "", "w", 0, "/", "%ED%A0%80A", "", "http://w/?%ED%A0%80A"});
</span><del>- checkURLDifferences(wideString<11>({'h', 't', 't', 'p', ':', '/', '/', 'w', '/', surrogateBegin, '\0'}),
</del><ins>+ checkURLDifferences(utf16String<11>({'h', 't', 't', 'p', ':', '/', '/', 'w', '/', surrogateBegin, '\0'}),
</ins><span class="cx"> {"http", "", "", "w", 0, "/%EF%BF%BD", "", "", "http://w/%EF%BF%BD"},
</span><span class="cx"> {"http", "", "", "w", 0, "/%ED%A0%80", "", "", "http://w/%ED%A0%80"});
</span><del>- checkURLDifferences(wideString<12>({'h', 't', 't', 'p', ':', '/', '/', 'w', '/', '?', surrogateBegin, '\0'}),
</del><ins>+ checkURLDifferences(utf16String<12>({'h', 't', 't', 'p', ':', '/', '/', 'w', '/', '?', surrogateBegin, '\0'}),
</ins><span class="cx"> {"http", "", "", "w", 0, "/", "%EF%BF%BD", "", "http://w/?%EF%BF%BD"},
</span><span class="cx"> {"http", "", "", "w", 0, "/", "%ED%A0%80", "", "http://w/?%ED%A0%80"});
</span><del>- checkURLDifferences(wideString<13>({'h', 't', 't', 'p', ':', '/', '/', 'w', '/', '?', surrogateBegin, ' ', '\0'}),
</del><ins>+ checkURLDifferences(utf16String<13>({'h', 't', 't', 'p', ':', '/', '/', 'w', '/', '?', surrogateBegin, ' ', '\0'}),
</ins><span class="cx"> {"http", "", "", "w", 0, "/", "%EF%BF%BD", "", "http://w/?%EF%BF%BD"},
</span><span class="cx"> {"http", "", "", "w", 0, "/", "%ED%A0%80", "", "http://w/?%ED%A0%80"});
</span><span class="cx"> }
</span><span class="lines">@@ -780,7 +780,7 @@
</span><span class="cx">
</span><span class="cx"> TEST_F(URLParserTest, QueryEncoding)
</span><span class="cx"> {
</span><del>- checkURL(wideString(L"http://host?ß😍#ß😍"), UTF8Encoding(), {"http", "", "", "host", 0, "/", "%C3%9F%F0%9F%98%8D", wideString(L"ß😍"), wideString(L"http://host/?%C3%9F%F0%9F%98%8D#ß😍")});
</del><ins>+ checkURL(utf16String(u"http://host?ß😍#ß😍"), UTF8Encoding(), {"http", "", "", "host", 0, "/", "%C3%9F%F0%9F%98%8D", utf16String(u"ß😍"), utf16String(u"http://host/?%C3%9F%F0%9F%98%8D#ß😍")});
</ins><span class="cx"> // FIXME: Add tests with other encodings.
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>