aboutsummaryrefslogtreecommitdiff
path: root/tests/url/driver.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-07-09 17:20:37 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-07-09 17:20:37 +0300
commit681ca375fd5af01501a91a78214ab7a26ad67ac7 (patch)
treecdf464f5001ce891e1129e07fc97253c9b321cb5 /tests/url/driver.cxx
parent726f4573a5d183a685e0a1032a3e247e3b47482e (diff)
Make basic_url(string) ctor to consider empty string as invalid argument
Diffstat (limited to 'tests/url/driver.cxx')
-rw-r--r--tests/url/driver.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/url/driver.cxx b/tests/url/driver.cxx
index 5fbeaa2..64bc2b5 100644
--- a/tests/url/driver.cxx
+++ b/tests/url/driver.cxx
@@ -169,9 +169,8 @@ try
// Test ctors and operators.
//
{
- wurl u0 ((wstring ()));
+ wurl u0;
assert (u0.empty ());
- assert (u0 == wurl ());
wurl u1 (scheme::http,
wurl_authority {wstring (), wurl_host (L"[123]"), 0},
@@ -288,7 +287,7 @@ try
{
case print_mode::str:
{
- cout << url (ua) << endl;
+ cout << (*ua != '\0' ? url (ua) : url ()) << endl;
break;
}
case print_mode::wstr:
@@ -297,7 +296,7 @@ try
//
wstring s (ua, ua + strlen (ua));
- wcout << wurl (s) << endl;
+ wcout << (!s.empty () ? wurl (s) : wurl ()) << endl;
break;
}
case print_mode::comp:
@@ -305,7 +304,10 @@ try
// Convert ASCII string to wstring.
//
wstring s (ua, ua + strlen (ua));
- wurl u (s);
+
+ wurl u;
+ if (!s.empty ())
+ u = wurl (s);
if (!u.empty ())
{