summaryrefslogtreecommitdiff
path: root/test/UtilTest.cc
Commit message (Collapse)AuthorAgeFilesLines
* Split UtilTest.cc into UtilTest1.cc and UtilTest2.ccTatsuhiro Tsujikawa2015-02-081-2303/+0
|
* Remove some left-over code from converting a test.Nils Maier2015-01-261-4/+0
| | | | Checking once with CPPUNIT_ASSERT_MESSAGE should suffice.
* Revise getRandom facilitiesNils Maier2015-01-201-2/+46
| | | | | | | | | | | | | | Use one of the following to provide random bytes: - Windows CryptGenRandom - Linux getrandom (syscall interface to urandom, without nasty corner cases such as file descriptor exhaustion or re-linked /dev/urandom) - std::device_random (C++ random device, which usually will be urandom) This also equalizes util::getRandom and SimpleRandomizer (the former will now use the latter) instead of having essentially two different PRNG interfaces with potentially different quality. Closes GH-320
* util::parseIntSegments: Return SegList<int>Tatsuhiro Tsujikawa2014-06-041-39/+34
|
* util::percentEncodeMini: Fix regression bug removed unsignednessTatsuhiro Tsujikawa2013-09-301-0/+8
| | | | | srange-based for around std::string is convenient but several functions depend unsigned char for correctness and readability.
* Rewrite util::divideTatsuhiro Tsujikawa2013-06-251-6/+5
|
* Remove vbegin and vend in favor of std::begin and std::endTatsuhiro Tsujikawa2013-06-241-5/+8
|
* Require -std=c++11 and use std::shared_ptr instead of SharedHandleTatsuhiro Tsujikawa2013-06-221-5/+5
|
* Accept k and m as well as K and M in util::getRealSize()Tatsuhiro Tsujikawa2013-01-151-0/+2
|
* Changed threshold of using upper unit for abbrevSizeTatsuhiro Tsujikawa2012-12-191-2/+1
|
* Compact readout when more than 1 simultaneous downloads are going onTatsuhiro Tsujikawa2012-12-111-5/+8
| | | | | | | | If more than 1 simultaneous downloads are going on, use more compact format in readout. Currently, at most 5 download stats are displayed. util::abbrevSize() is rewritten to support "Gi" unit and provides more compact abbreviation.
* Made return type of util::parse_content_disposition ssize_tTatsuhiro Tsujikawa2012-11-011-91/+91
|
* Content-Disposition parser conforming to RFC 6266.Tatsuhiro Tsujikawa2012-10-271-104/+606
| | | | RFC 2231 Continuation is not supported.
* Removed trailing spacesTatsuhiro Tsujikawa2012-10-011-5/+5
|
* Removed unused functionsTatsuhiro Tsujikawa2012-09-271-22/+0
|
* Use nothrow version of parseInt, parseUInt and parseLLIntTatsuhiro Tsujikawa2012-09-271-100/+0
|
* Made BufferedFile ctor take const char* argsTatsuhiro Tsujikawa2012-09-251-1/+1
|
* Don't percent-decode filename value in Content-Disposition.Tatsuhiro Tsujikawa2012-06-281-1/+3
| | | | | | We only percent-decode filename* value in Content-Disposition because the encoding is fully specified. But since filename value is not, so we just accept it as is.
* Rewritten TLS hostname check based on RFC 6125.Tatsuhiro Tsujikawa2012-03-301-18/+17
|
* Added hostname check described in RFC 2818 with OpenSSL.Tatsuhiro Tsujikawa2012-03-281-0/+27
|
* Avoid strlen in util::streq, util::strieq, util::startsWith and ↵Tatsuhiro Tsujikawa2012-01-111-0/+20
| | | | util::istartsWith
* Removed static const char[] as much as possible.Tatsuhiro Tsujikawa2012-01-111-30/+16
| | | | | Provided convenient functions for streq, strieq, startsWith, istartsWith, endsWith, iendsWith to support this move.
* Replaced uint64_t with off_t or int64_t.Tatsuhiro Tsujikawa2011-12-091-22/+0
| | | | | Since off_t is int64_t with LFS, we cannot take advantage of extra capacity of uint64_t.
* Changed format of ETA.Tatsuhiro Tsujikawa2011-11-131-0/+15
| | | | | Now no leading 0 is used. If hour part and/or min part is non-zero, and sec part is 0, sec part is omitted, like this "1h3m".
* Don't append character to std::string.Tatsuhiro Tsujikawa2011-11-121-0/+15
|
* Rewritten parse*IntTatsuhiro Tsujikawa2011-11-121-39/+39
|
* HttpHeader::fill() now stores header name in lowercase.Tatsuhiro Tsujikawa2011-11-111-0/+18
| | | | | Find methods in HttpHeader won't lowercase argument, so use lowercase letters to get HTTP header field.
* Rewritten parametered URI handling routine.Tatsuhiro Tsujikawa2011-11-061-15/+30
|
* Made util::fromHex and base32::decode function templateTatsuhiro Tsujikawa2011-11-051-22/+22
|
* Rewritten bencode2::decode functionsTatsuhiro Tsujikawa2011-11-051-1/+1
|
* Added util::istartsWith()Tatsuhiro Tsujikawa2011-11-051-0/+17
|
* Removed util::endsWith(a, b). Added util::iendsWith()Tatsuhiro Tsujikawa2011-11-051-8/+14
|
* Removed util::startsWith(a, b)Tatsuhiro Tsujikawa2011-11-041-7/+0
|
* Rewritten util::split and added its iterator version.Tatsuhiro Tsujikawa2011-11-041-14/+383
| | | | | Iterator based functions util::startsWith, util::endsWith, util::streq, util::strieq were added.
* util::divide now takes iterators as arguments.Tatsuhiro Tsujikawa2011-11-031-16/+35
|
* util::percentDecode now takes iterators as arguments.Tatsuhiro Tsujikawa2011-11-031-6/+11
|
* Changed parse*Int functions so that it accepts iterators.Tatsuhiro Tsujikawa2011-11-031-40/+124
|
* Rewritten parseIndexPath. Renamed createIndexPathMap as createIndexPaths.Tatsuhiro Tsujikawa2011-11-021-9/+9
|
* Removed IntSequence and Sequence<T>Tatsuhiro Tsujikawa2011-10-301-62/+0
|
* Use SegList<int> instead of IntSequence in DownloadContext::setFileFilter()Tatsuhiro Tsujikawa2011-10-291-0/+75
|
* Use same domain-match algorithm for no-proxy and netrc.Tatsuhiro Tsujikawa2011-10-291-0/+13
| | | | | Now "example.org" does not domain-match ".example.org" in both functions.
* Rewritten util::inSameCidrBlock() to support IPv6 address.Tatsuhiro Tsujikawa2011-10-191-25/+10
| | | | We also introduced union sockaddr_union in a2netcompat.h.
* Fixed output file path of tests.Tatsuhiro Tsujikawa2011-08-251-1/+1
|
* Use global::cout to output string to stdout.Tatsuhiro Tsujikawa2011-08-091-2/+7
| | | | | | | In MinGW32 build, global::cout is WinConsoleFile. When outputing to console, it uses WriteConsoleW, so Unicode characters are written. Fixed memory leak in WChar<->MultiByte conversion functions. The portion of code which uses std::cout is rewritten to use global::cout.
* Added Metalink/HTTP Link and Digest header field parser.Tatsuhiro Tsujikawa2011-07-261-0/+40
|
* Moved joinUri from util namespace to uri namespace.Tatsuhiro Tsujikawa2011-05-061-50/+0
|
* Handle "..", "." in util::joinUri()Tatsuhiro Tsujikawa2011-04-301-0/+27
|
* Added util::joinUri()Tatsuhiro Tsujikawa2011-04-301-0/+23
|
* Made `make distcheck' pass.Tatsuhiro Tsujikawa2010-12-021-1/+1
| | | | | | We added 2 macros A2_TEST_DIR and A2_TEST_OUT_DIR to pass tests in `make distcheck`. A2_TEST_DIR refers to test directory. All output files by unit tests are now created under A2_TEST_OUT_DIR directory.
* 2010-11-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-151-0/+18
| | | | | | | | | | | | | | | | | | | | | | Replaced HttpHeader::responseStatus_ with HttpHeader::statusCode_. statusCode_ is of type int. * src/AbstractProxyResponseCommand.cc * src/FtpNegotiationCommand.cc * src/HttpHeader.cc * src/HttpHeader.h * src/HttpHeaderProcessor.cc * src/HttpResponse.cc * src/HttpResponse.h * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/util.cc * src/util.h * test/HttpHeaderProcessorTest.cc * test/HttpHeaderTest.cc * test/HttpResponseTest.cc * test/UtilTest.cc