]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/tests/testURL.cc
2 * Copyright (C) 1996-2015 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>
14 #include "unitTestMain.h"
19 CPPUNIT_TEST_SUITE_REGISTRATION( testURL
);
21 /* init memory pools */
30 * we can construct a URL with a AnyP::UriScheme.
31 * This creates a URL for that scheme.
34 testURL::testConstructScheme()
36 AnyP::UriScheme empty_scheme
;
37 URL
protoless_url(AnyP::PROTO_NONE
);
38 CPPUNIT_ASSERT_EQUAL(empty_scheme
, protoless_url
.getScheme());
40 AnyP::UriScheme
ftp_scheme(AnyP::PROTO_FTP
);
41 URL
ftp_url(AnyP::PROTO_FTP
);
42 CPPUNIT_ASSERT_EQUAL(ftp_scheme
, ftp_url
.getScheme());
46 * a default constructed URL has scheme "NONE".
47 * Also, we should be able to use new and delete on
51 testURL::testDefaultConstructor()
53 AnyP::UriScheme aScheme
;
55 CPPUNIT_ASSERT_EQUAL(aScheme
, aUrl
.getScheme());
57 URL
*urlPointer
= new URL
;
58 CPPUNIT_ASSERT(urlPointer
!= NULL
);