10
10
#include < boost/network/uri/uri.hpp>
11
11
#include < boost/network/uri/uri_io.hpp>
12
12
#include < boost/range/algorithm/equal.hpp>
13
+ #include < boost/scoped_ptr.hpp>
13
14
#include < map>
14
15
15
16
@@ -397,16 +398,15 @@ BOOST_AUTO_TEST_CASE(xmpp_query_map_test) {
397
398
BOOST_CHECK_EQUAL ((++queries.begin ())->second , " Hello%20World" );
398
399
}
399
400
400
- BOOST_AUTO_TEST_CASE (range_test)
401
- {
401
+ BOOST_AUTO_TEST_CASE (range_test) {
402
402
const std::string url (" http://www.example.com/" );
403
403
uri::uri instance (url);
404
404
BOOST_REQUIRE (uri::valid (instance));
405
405
BOOST_CHECK (boost::equal (instance, url));
406
406
}
407
407
408
- BOOST_AUTO_TEST_CASE (issue_67_test)
409
- {
408
+ BOOST_AUTO_TEST_CASE (issue_67_test) {
409
+ // https://github.com/cpp-netlib/cpp-netlib/issues/67
410
410
const std::string site_name (" http://www.google.com" );
411
411
uri::uri bar0;
412
412
uri::uri bar1 = site_name;
@@ -415,32 +415,35 @@ BOOST_AUTO_TEST_CASE(issue_67_test)
415
415
BOOST_CHECK (uri::is_valid (bar1));
416
416
}
417
417
418
- BOOST_AUTO_TEST_CASE (from_parts_1)
419
- {
418
+ BOOST_AUTO_TEST_CASE (from_parts_1) {
420
419
BOOST_CHECK_EQUAL (uri::uri (" http://www.example.com/path?query#fragment" ),
421
420
uri::from_parts (uri::uri (" http://www.example.com" ), " /path" , " query" , " fragment" ));
422
421
}
423
422
424
- BOOST_AUTO_TEST_CASE (from_parts_2)
425
- {
423
+ BOOST_AUTO_TEST_CASE (from_parts_2) {
426
424
BOOST_CHECK_EQUAL (uri::uri (" http://www.example.com/path?query#fragment" ),
427
425
uri::from_parts (" http://www.example.com" , " /path" , " query" , " fragment" ));
428
426
}
429
427
430
- BOOST_AUTO_TEST_CASE (from_parts_3)
431
- {
428
+ BOOST_AUTO_TEST_CASE (from_parts_3) {
432
429
BOOST_CHECK_EQUAL (uri::uri (" http://www.example.com/path?query" ),
433
430
uri::from_parts (" http://www.example.com" , " /path" , " query" ));
434
431
}
435
432
436
- BOOST_AUTO_TEST_CASE (from_parts_4)
437
- {
433
+ BOOST_AUTO_TEST_CASE (from_parts_4) {
438
434
BOOST_CHECK_EQUAL (uri::uri (" http://www.example.com/path" ),
439
435
uri::from_parts (" http://www.example.com" , " /path" ));
440
436
}
441
437
442
- BOOST_AUTO_TEST_CASE (from_file)
443
- {
438
+ BOOST_AUTO_TEST_CASE (from_file) {
444
439
boost::filesystem::path path (" /a/path/to/a/file.txt" );
445
440
BOOST_CHECK_EQUAL (uri::uri (" file:///a/path/to/a/file.txt" ), uri::from_file (path));
446
441
}
442
+
443
+ BOOST_AUTO_TEST_CASE (issue_104_test) {
444
+ // https://github.com/cpp-netlib/cpp-netlib/issues/104
445
+ boost::scoped_ptr<uri::uri> instance (new uri::uri (" http://www.example.com/" ));
446
+ uri::uri copy = *instance;
447
+ instance.reset ();
448
+ BOOST_CHECK_EQUAL (uri::scheme (copy), " http" );
449
+ }
0 commit comments