]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/tests/testURL.cc
2 * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
11 #include <cppunit/TestAssert.h>
15 #include "unitTestMain.h"
20 CPPUNIT_TEST_SUITE_REGISTRATION( testURL
);
22 /* init memory pools */
28 AnyP::UriScheme::Init();
32 * we can construct a URL with a AnyP::UriScheme.
33 * This creates a URL for that scheme.
36 testURL::testConstructScheme()
38 AnyP::UriScheme empty_scheme
;
39 URL
protoless_url(AnyP::PROTO_NONE
);
40 CPPUNIT_ASSERT_EQUAL(empty_scheme
, protoless_url
.getScheme());
42 AnyP::UriScheme
ftp_scheme(AnyP::PROTO_FTP
);
43 URL
ftp_url(AnyP::PROTO_FTP
);
44 CPPUNIT_ASSERT_EQUAL(ftp_scheme
, ftp_url
.getScheme());
48 * a default constructed URL has scheme "NONE".
49 * Also, we should be able to use new and delete on
53 testURL::testDefaultConstructor()
55 AnyP::UriScheme aScheme
;
57 CPPUNIT_ASSERT_EQUAL(aScheme
, aUrl
.getScheme());
59 URL
*urlPointer
= new URL
;
60 CPPUNIT_ASSERT(urlPointer
!= NULL
);