1010#include < boost/network/uri/uri.hpp>
1111#include < boost/network/uri/uri_io.hpp>
1212#include < boost/range/algorithm/equal.hpp>
13+ #include < boost/scoped_ptr.hpp>
1314#include < map>
1415
1516
@@ -397,16 +398,15 @@ BOOST_AUTO_TEST_CASE(xmpp_query_map_test) {
397398BOOST_CHECK_EQUAL ((++queries.begin ())->second ," Hello%20World" );
398399}
399400
400- BOOST_AUTO_TEST_CASE (range_test)
401- {
401+ BOOST_AUTO_TEST_CASE (range_test) {
402402const std::stringurl (" http://www.example.com/" );
403403 uri::uriinstance (url);
404404BOOST_REQUIRE (uri::valid (instance));
405405BOOST_CHECK (boost::equal (instance, url));
406406}
407407
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
410410const std::stringsite_name (" http://www.google.com" );
411411 uri::uri bar0;
412412 uri::uri bar1 = site_name;
@@ -415,32 +415,35 @@ BOOST_AUTO_TEST_CASE(issue_67_test)
415415BOOST_CHECK (uri::is_valid (bar1));
416416}
417417
418- BOOST_AUTO_TEST_CASE (from_parts_1)
419- {
418+ BOOST_AUTO_TEST_CASE (from_parts_1) {
420419BOOST_CHECK_EQUAL (uri::uri (" http://www.example.com/path?query#fragment" ),
421420uri::from_parts (uri::uri (" http://www.example.com" )," /path" ," query" ," fragment" ));
422421}
423422
424- BOOST_AUTO_TEST_CASE (from_parts_2)
425- {
423+ BOOST_AUTO_TEST_CASE (from_parts_2) {
426424BOOST_CHECK_EQUAL (uri::uri (" http://www.example.com/path?query#fragment" ),
427425uri::from_parts (" http://www.example.com" ," /path" ," query" ," fragment" ));
428426}
429427
430- BOOST_AUTO_TEST_CASE (from_parts_3)
431- {
428+ BOOST_AUTO_TEST_CASE (from_parts_3) {
432429BOOST_CHECK_EQUAL (uri::uri (" http://www.example.com/path?query" ),
433430uri::from_parts (" http://www.example.com" ," /path" ," query" ));
434431}
435432
436- BOOST_AUTO_TEST_CASE (from_parts_4)
437- {
433+ BOOST_AUTO_TEST_CASE (from_parts_4) {
438434BOOST_CHECK_EQUAL (uri::uri (" http://www.example.com/path" ),
439435uri::from_parts (" http://www.example.com" ," /path" ));
440436}
441437
442- BOOST_AUTO_TEST_CASE (from_file)
443- {
438+ BOOST_AUTO_TEST_CASE (from_file) {
444439 boost::filesystem::pathpath (" /a/path/to/a/file.txt" );
445440BOOST_CHECK_EQUAL (uri::uri (" file:///a/path/to/a/file.txt" ),uri::from_file (path));
446441}
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+ }