+void URLTestCase::CopyAndAssignment()
+{
+ wxURL url1("http://www.example.org/");
+ wxURL url2;
+ wxURI *puri = &url2; // downcast
+
+ { // Copy constructor
+ wxURL url3(url1);
+ CPPUNIT_ASSERT(url1 == url3);
+ }
+ { // Constructor for string
+ wxURL url3(url1.GetURL());
+ CPPUNIT_ASSERT(url1 == url3);
+ }
+ { // 'Copy' constructor for uri
+ wxURL url3(*puri);
+ CPPUNIT_ASSERT(url2 == url3);
+ }
+
+ // assignment for uri
+ *puri = url1;
+ CPPUNIT_ASSERT(url1 == url2);
+
+ // assignment to self through base pointer
+ *puri = url2;
+
+ // Assignment of string
+ url1 = wxS("http://www.example2.org/index.html");
+ *puri = wxS("http://www.example2.org/index.html");
+ CPPUNIT_ASSERT(url1 == url2);
+
+ // Assignment
+ url1 = wxS("");
+ url2 = url1;
+ CPPUNIT_ASSERT(url1 == url2);
+
+ // assignment to self
+ url2 = url2;
+
+ // check for destructor (with base pointer!)
+ puri = new wxURL();
+ delete puri;
+}