]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/tests/testURL.cc
Source Format Enforcement (#763)
[thirdparty/squid.git] / src / tests / testURL.cc
index 379d431e9d25aec330078506b9f2d644b8c63d6b..d77e1f00ac8d435929169769581e298904455834 100644 (file)
@@ -1,15 +1,21 @@
-#define SQUID_UNIT_TEST 1
+/*
+ * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
 #include "squid.h"
 
 #include <cppunit/TestAssert.h>
 
-#include "Mem.h"
-#include "testURL.h"
-#include "URL.h"
+#include "anyp/Uri.h"
+#include "Debug.h"
+#include "tests/testURL.h"
+#include "unitTestMain.h"
 
-#if HAVE_SSTREAM
 #include <sstream>
-#endif
 
 CPPUNIT_TEST_SUITE_REGISTRATION( testURL );
 
@@ -19,21 +25,22 @@ void
 testURL::setUp()
 {
     Mem::Init();
+    AnyP::UriScheme::Init();
 }
 
 /*
- * we can construct a URL with a URLScheme.
+ * we can construct a URL with a AnyP::UriScheme.
  * This creates a URL for that scheme.
  */
 void
 testURL::testConstructScheme()
 {
-    URLScheme empty_scheme;
-    URL protoless_url(AnyP::PROTO_NONE);
+    AnyP::UriScheme empty_scheme;
+    AnyP::Uri protoless_url(AnyP::PROTO_NONE);
     CPPUNIT_ASSERT_EQUAL(empty_scheme, protoless_url.getScheme());
 
-    URLScheme ftp_scheme(AnyP::PROTO_FTP);
-    URL ftp_url(AnyP::PROTO_FTP);
+    AnyP::UriScheme ftp_scheme(AnyP::PROTO_FTP);
+    AnyP::Uri ftp_url(AnyP::PROTO_FTP);
     CPPUNIT_ASSERT_EQUAL(ftp_scheme, ftp_url.getScheme());
 }
 
@@ -45,11 +52,12 @@ testURL::testConstructScheme()
 void
 testURL::testDefaultConstructor()
 {
-    URLScheme aScheme;
-    URL aUrl;
+    AnyP::UriScheme aScheme;
+    AnyP::Uri aUrl;
     CPPUNIT_ASSERT_EQUAL(aScheme, aUrl.getScheme());
 
-    URL *urlPointer = new URL;
+    auto *urlPointer = new AnyP::Uri;
     CPPUNIT_ASSERT(urlPointer != NULL);
     delete urlPointer;
 }
+