]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/tests/testURL.cc
2 * Copyright (C) 1996-2016 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 */
31 * we can construct a URL with a AnyP::UriScheme.
32 * This creates a URL for that scheme.
35 testURL::testConstructScheme()
37 AnyP::UriScheme empty_scheme
;
38 URL
protoless_url(AnyP::PROTO_NONE
);
39 CPPUNIT_ASSERT_EQUAL(empty_scheme
, protoless_url
.getScheme());
41 AnyP::UriScheme
ftp_scheme(AnyP::PROTO_FTP
);
42 URL
ftp_url(AnyP::PROTO_FTP
);
43 CPPUNIT_ASSERT_EQUAL(ftp_scheme
, ftp_url
.getScheme());
47 * a default constructed URL has scheme "NONE".
48 * Also, we should be able to use new and delete on
52 testURL::testDefaultConstructor()
54 AnyP::UriScheme aScheme
;
56 CPPUNIT_ASSERT_EQUAL(aScheme
, aUrl
.getScheme());
58 URL
*urlPointer
= new URL
;
59 CPPUNIT_ASSERT(urlPointer
!= NULL
);