activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r742727 - in /activemq/activemq-cpp/trunk/src: main/decaf/net/URI.cpp test/decaf/net/URITest.cpp test/testRegistry.cpp
Date Mon, 09 Feb 2009 20:44:32 GMT
Author: tabish
Date: Mon Feb  9 20:44:32 2009
New Revision: 742727

URL: http://svn.apache.org/viewvc?rev=742727&view=rev
Log:
Fix minor issue in the URI class.

Modified:
    activemq/activemq-cpp/trunk/src/main/decaf/net/URI.cpp
    activemq/activemq-cpp/trunk/src/test/decaf/net/URITest.cpp
    activemq/activemq-cpp/trunk/src/test/testRegistry.cpp

Modified: activemq/activemq-cpp/trunk/src/main/decaf/net/URI.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/net/URI.cpp?rev=742727&r1=742726&r2=742727&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/net/URI.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/net/URI.cpp Mon Feb  9 20:44:32 2009
@@ -822,6 +822,7 @@
     result.uri.setQuery( relative.uri.getQuery() );
     // the result URI is the remainder of the relative URI's path
     result.uri.setPath( relativePath.substr( thisPath.length() ) );
+    result.setSchemeSpecificPart();
 
     return result;
 }
@@ -875,7 +876,7 @@
             result.uri.setPath( relative.uri.getPath() );
         } else {
             // resolve a relative reference
-			std::size_t endindex = this->uri.getPath().find_last_of('/') + 1;
+            std::size_t endindex = this->uri.getPath().find_last_of('/') + 1;
             result.uri.setPath( normalize(
                 this->uri.getPath().substr( 0, endindex ) + relative.uri.getPath() ) );
         }

Modified: activemq/activemq-cpp/trunk/src/test/decaf/net/URITest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/decaf/net/URITest.cpp?rev=742727&r1=742726&r2=742727&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/decaf/net/URITest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/decaf/net/URITest.cpp Mon Feb  9 20:44:32 2009
@@ -1523,6 +1523,14 @@
         URI result( "p1" );
         CPPUNIT_ASSERT( result.equals( one.relativize( two ) ) );
     }
+    {
+        URI uri( "file", "", "/test/location", "" );
+        URI base( "file", "", "/test", "" );
+
+        URI relative = base.relativize( uri );
+        CPPUNIT_ASSERT( string( "location" ) == relative.getSchemeSpecificPart() );
+        CPPUNIT_ASSERT( relative.getScheme() == "" );
+    }
 }
 
 

Modified: activemq/activemq-cpp/trunk/src/test/testRegistry.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/testRegistry.cpp?rev=742727&r1=742726&r2=742727&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/testRegistry.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/testRegistry.cpp Mon Feb  9 20:44:32 2009
@@ -183,8 +183,8 @@
 //CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::SocketFactoryTest );
 //#include <decaf/net/SocketTest.h>
 //CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::SocketTest );
-//#include <decaf/net/URITest.h>
-//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::URITest );
+#include <decaf/net/URITest.h>
+CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::URITest );
 //#include <decaf/net/URISyntaxExceptionTest.h>
 //CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::URISyntaxExceptionTest );
 //#include <decaf/net/URLEncoderTest.h>



Mime
View raw message