]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/tests/testURL.cc
2 * Copyright (C) 1996-2014 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>
18 CPPUNIT_TEST_SUITE_REGISTRATION( testURL
);
20 /* init memory pools */
29 * we can construct a URL with a AnyP::UriScheme.
30 * This creates a URL for that scheme.
33 testURL::testConstructScheme()
35 AnyP::UriScheme empty_scheme
;
36 URL
protoless_url(AnyP::PROTO_NONE
);
37 CPPUNIT_ASSERT_EQUAL(empty_scheme
, protoless_url
.getScheme());
39 AnyP::UriScheme
ftp_scheme(AnyP::PROTO_FTP
);
40 URL
ftp_url(AnyP::PROTO_FTP
);
41 CPPUNIT_ASSERT_EQUAL(ftp_scheme
, ftp_url
.getScheme());
45 * a default constructed URL has scheme "NONE".
46 * Also, we should be able to use new and delete on
50 testURL::testDefaultConstructor()
52 AnyP::UriScheme aScheme
;
54 CPPUNIT_ASSERT_EQUAL(aScheme
, aUrl
.getScheme());
56 URL
*urlPointer
= new URL
;
57 CPPUNIT_ASSERT(urlPointer
!= NULL
);