Utils::Testing::UriTest Class Reference

Inherits TestFixture.

Inheritance diagram for Utils::Testing::UriTest:

Inheritance graph
[legend]
Collaboration diagram for Utils::Testing::UriTest:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 33 of file UriTest.cpp.

Public Member Functions

void scenarioParseAndWrite (bool encoded, const QByteArray &bytes, const QByteArray &scheme, const QByteArray &authority, const QByteArray &path, const QByteArray &query, const QByteArray &fragment)
void testNoEncodingScheme ()
void testNoEncodingSchemeWithEmptyAuthority ()
void testNoEncodingSchemeWithAuthority ()
void testNoEncodingSchemeWithEmptyAuthorityWithEmptyPathWithEmptyQuery ()
void testNoEncodingSchemeWithEmptyAuthorityWithEmptyPathWithEmptyFragment ()
void testNoEncodingSchemeWithEmptyAuthorityWithEmptyPathWithEmptyQueryWithEmptyFragment ()
void testNoEncodingSchemeWithEmptyAuthorityWithPath ()
void testNoEncodingSchemeWithAuthorityWithPath ()
void testNoEncodingSchemeWithAuthorityWithQuery ()
void testNoEncodingSchemeWithAuthorityWithFragment ()
void testNoEncodingSchemeWithAuthorityWithPathWithQueryWithFragment ()
void testNoEncodingAuthorityWithPathWithQueryWithFragment ()
void testNoEncodingPathWithQueryWithFragment ()
void testNoEncodingQueryWithFragment ()
void testNoEncodingQuery ()
void testNoEncodingFragment ()
void testEncodingIncorrectlyUncodedUriIsNull ()
void testEncodingCorrectlyEncodedUri ()
void scenarioParseUriAndAppendQuery (const QByteArray &bytes, const QByteArray &initialQuery, const QList< QByteArray > &extraQueries)
void testParseUriWithoutQueryThenAppendQueryTwice ()
void testParseUriWithQueryThenAppendQueryTwice ()
void scenarioParseUriAndAppendQueryItem (const QByteArray &bytes, const QByteArray &initialQuery, const Uri::QueryItemList &items)
void testParseUriWithoutQueryThenAppendQueryItemAFewTimes ()
void testParseUriWithQueryThenAppendQueryItemAFewTimes ()
void testParseUnencodedProduceEncoded ()
void testCompareTwoEqualNonEmptyUris ()
void testCompareTwoEqualEmptyUris ()
void testCompareTwoDifferentNonEmptyUris ()
void testCompareEmptyAndNonEmptyUris ()
void testCompareUrisWithEmptyAndNullQuery ()
void testKeysAndValuesInQueryItemsGetCorrectlyEncoded ()
 '&' and '=' in query items should be correctly encoded.
void testParseEncodedUriQueryIsNotPrematurelyDecoded ()
void testParseQueryItemsFromQueryTwoItems ()
void testParseQueryItemsFromEmptyQuery ()
void testEncodingAllCharsInQuery ()
void testQueryItemValueNoneValueAssociated ()
 Verifies that QByteArray() will be returned when no value is associated.
void testQueryItemValueOneValueAssociated ()
 Verifies that correct value will be returned if one value is associated.
void testQueryItemValueTwoValuesAssociated ()
 Verifies that correct value will be returned if two values are associated.
void testParsingUriWithPortButWithoutHostFails ()
 "scheme://:80/" is invalid, parsing should result is Uri().
void testParsingUriWithUserinfoButWithoutHostFails ()
 "scheme://userinfo@/" is invalid, parsing should result is Uri().
void testParsingUriWithUserinfoAndPortButWithoutHostFails ()
 "scheme://userinfo@:80" is invalid, parsing should result is Uri().
void testGettingSubsetsOfEncodedRepresentation ()

Private Member Functions

 CPPUNIT_TEST_SUITE (UriTest)
 CPPUNIT_TEST (testNoEncodingScheme)
 CPPUNIT_TEST (testNoEncodingSchemeWithEmptyAuthority)
 CPPUNIT_TEST (testNoEncodingSchemeWithAuthority)
 CPPUNIT_TEST (testNoEncodingSchemeWithEmptyAuthorityWithPath)
 CPPUNIT_TEST (testNoEncodingSchemeWithEmptyAuthorityWithEmptyPathWithEmptyQuery)
 CPPUNIT_TEST (testNoEncodingSchemeWithEmptyAuthorityWithEmptyPathWithEmptyFragment)
 CPPUNIT_TEST (testNoEncodingSchemeWithEmptyAuthorityWithEmptyPathWithEmptyQueryWithEmptyFragment)
 CPPUNIT_TEST (testNoEncodingSchemeWithAuthorityWithPath)
 CPPUNIT_TEST (testNoEncodingSchemeWithAuthorityWithQuery)
 CPPUNIT_TEST (testNoEncodingSchemeWithAuthorityWithFragment)
 CPPUNIT_TEST (testNoEncodingSchemeWithAuthorityWithPathWithQueryWithFragment)
 CPPUNIT_TEST (testNoEncodingAuthorityWithPathWithQueryWithFragment)
 CPPUNIT_TEST (testNoEncodingPathWithQueryWithFragment)
 CPPUNIT_TEST (testNoEncodingQueryWithFragment)
 CPPUNIT_TEST (testNoEncodingQuery)
 CPPUNIT_TEST (testNoEncodingFragment)
 CPPUNIT_TEST (testEncodingIncorrectlyUncodedUriIsNull)
 CPPUNIT_TEST (testEncodingCorrectlyEncodedUri)
 CPPUNIT_TEST (testParseUriWithoutQueryThenAppendQueryTwice)
 CPPUNIT_TEST (testParseUriWithQueryThenAppendQueryTwice)
 CPPUNIT_TEST (testParseUriWithoutQueryThenAppendQueryItemAFewTimes)
 CPPUNIT_TEST (testParseUriWithQueryThenAppendQueryItemAFewTimes)
 CPPUNIT_TEST (testParseUnencodedProduceEncoded)
 CPPUNIT_TEST (testCompareTwoEqualNonEmptyUris)
 CPPUNIT_TEST (testCompareTwoEqualEmptyUris)
 CPPUNIT_TEST (testCompareTwoDifferentNonEmptyUris)
 CPPUNIT_TEST (testCompareEmptyAndNonEmptyUris)
 CPPUNIT_TEST (testCompareUrisWithEmptyAndNullQuery)
 CPPUNIT_TEST (testKeysAndValuesInQueryItemsGetCorrectlyEncoded)
 CPPUNIT_TEST (testParseEncodedUriQueryIsNotPrematurelyDecoded)
 CPPUNIT_TEST (testParseQueryItemsFromQueryTwoItems)
 CPPUNIT_TEST (testParseQueryItemsFromEmptyQuery)
 CPPUNIT_TEST (testEncodingAllCharsInQuery)
 CPPUNIT_TEST (testQueryItemValueNoneValueAssociated)
 CPPUNIT_TEST (testQueryItemValueOneValueAssociated)
 CPPUNIT_TEST (testQueryItemValueTwoValuesAssociated)
 CPPUNIT_TEST (testParsingUriWithPortButWithoutHostFails)
 CPPUNIT_TEST (testParsingUriWithUserinfoButWithoutHostFails)
 CPPUNIT_TEST (testParsingUriWithUserinfoAndPortButWithoutHostFails)
 CPPUNIT_TEST (testGettingSubsetsOfEncodedRepresentation)
 CPPUNIT_TEST_SUITE_END ()

Static Private Attributes

static const QByteArray validUriUnencoded1
static const QByteArray validUriUnencoded2


Member Function Documentation

Utils::Testing::UriTest::CPPUNIT_TEST testGettingSubsetsOfEncodedRepresentation   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testParsingUriWithUserinfoAndPortButWithoutHostFails   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testParsingUriWithUserinfoButWithoutHostFails   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testParsingUriWithPortButWithoutHostFails   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testQueryItemValueTwoValuesAssociated   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testQueryItemValueOneValueAssociated   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testQueryItemValueNoneValueAssociated   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testEncodingAllCharsInQuery   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testParseQueryItemsFromEmptyQuery   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testParseQueryItemsFromQueryTwoItems   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testParseEncodedUriQueryIsNotPrematurelyDecoded   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testKeysAndValuesInQueryItemsGetCorrectlyEncoded   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testCompareUrisWithEmptyAndNullQuery   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testCompareEmptyAndNonEmptyUris   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testCompareTwoDifferentNonEmptyUris   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testCompareTwoEqualEmptyUris   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testCompareTwoEqualNonEmptyUris   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testParseUnencodedProduceEncoded   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testParseUriWithQueryThenAppendQueryItemAFewTimes   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testParseUriWithoutQueryThenAppendQueryItemAFewTimes   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testParseUriWithQueryThenAppendQueryTwice   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testParseUriWithoutQueryThenAppendQueryTwice   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testEncodingCorrectlyEncodedUri   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testEncodingIncorrectlyUncodedUriIsNull   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testNoEncodingFragment   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testNoEncodingQuery   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testNoEncodingQueryWithFragment   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testNoEncodingPathWithQueryWithFragment   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testNoEncodingAuthorityWithPathWithQueryWithFragment   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testNoEncodingSchemeWithAuthorityWithPathWithQueryWithFragment   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testNoEncodingSchemeWithAuthorityWithFragment   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testNoEncodingSchemeWithAuthorityWithQuery   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testNoEncodingSchemeWithAuthorityWithPath   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testNoEncodingSchemeWithEmptyAuthorityWithEmptyPathWithEmptyQueryWithEmptyFragment   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testNoEncodingSchemeWithEmptyAuthorityWithEmptyPathWithEmptyFragment   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testNoEncodingSchemeWithEmptyAuthorityWithEmptyPathWithEmptyQuery   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testNoEncodingSchemeWithEmptyAuthorityWithPath   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testNoEncodingSchemeWithAuthority   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testNoEncodingSchemeWithEmptyAuthority   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST testNoEncodingScheme   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST_SUITE UriTest   )  [private]
 

Utils::Testing::UriTest::CPPUNIT_TEST_SUITE_END  )  [private]
 

void Utils::Testing::UriTest::scenarioParseAndWrite bool  encoded,
const QByteArray &  bytes,
const QByteArray &  scheme,
const QByteArray &  authority,
const QByteArray &  path,
const QByteArray &  query,
const QByteArray &  fragment
[inline]
 

Definition at line 83 of file UriTest.cpp.

void Utils::Testing::UriTest::scenarioParseUriAndAppendQuery const QByteArray &  bytes,
const QByteArray &  initialQuery,
const QList< QByteArray > &  extraQueries
[inline]
 

Definition at line 226 of file UriTest.cpp.

void Utils::Testing::UriTest::scenarioParseUriAndAppendQueryItem const QByteArray &  bytes,
const QByteArray &  initialQuery,
const Uri::QueryItemList items
[inline]
 

Definition at line 263 of file UriTest.cpp.

void Utils::Testing::UriTest::testCompareEmptyAndNonEmptyUris  )  [inline]
 

Definition at line 352 of file UriTest.cpp.

void Utils::Testing::UriTest::testCompareTwoDifferentNonEmptyUris  )  [inline]
 

Definition at line 343 of file UriTest.cpp.

void Utils::Testing::UriTest::testCompareTwoEqualEmptyUris  )  [inline]
 

Definition at line 336 of file UriTest.cpp.

void Utils::Testing::UriTest::testCompareTwoEqualNonEmptyUris  )  [inline]
 

Definition at line 327 of file UriTest.cpp.

void Utils::Testing::UriTest::testCompareUrisWithEmptyAndNullQuery  )  [inline]
 

Definition at line 361 of file UriTest.cpp.

void Utils::Testing::UriTest::testEncodingAllCharsInQuery  )  [inline]
 

Definition at line 410 of file UriTest.cpp.

void Utils::Testing::UriTest::testEncodingCorrectlyEncodedUri  )  [inline]
 

Definition at line 220 of file UriTest.cpp.

void Utils::Testing::UriTest::testEncodingIncorrectlyUncodedUriIsNull  )  [inline]
 

Definition at line 213 of file UriTest.cpp.

void Utils::Testing::UriTest::testGettingSubsetsOfEncodedRepresentation  )  [inline]
 

Note:
This function implicitly tests also the Uri::encoded() variant. The reason is that both unencoded() and encoded() are implemented in terms of the same private function.
Todo:
If scheme is missing, then there is no ":" after it. Similarly with userInfo, port, query, fragment...

Definition at line 498 of file UriTest.cpp.

void Utils::Testing::UriTest::testKeysAndValuesInQueryItemsGetCorrectlyEncoded  )  [inline]
 

'&' and '=' in query items should be correctly encoded.

Definition at line 371 of file UriTest.cpp.

void Utils::Testing::UriTest::testNoEncodingAuthorityWithPathWithQueryWithFragment  )  [inline]
 

Definition at line 183 of file UriTest.cpp.

void Utils::Testing::UriTest::testNoEncodingFragment  )  [inline]
 

Definition at line 207 of file UriTest.cpp.

void Utils::Testing::UriTest::testNoEncodingPathWithQueryWithFragment  )  [inline]
 

Definition at line 189 of file UriTest.cpp.

void Utils::Testing::UriTest::testNoEncodingQuery  )  [inline]
 

Definition at line 201 of file UriTest.cpp.

void Utils::Testing::UriTest::testNoEncodingQueryWithFragment  )  [inline]
 

Definition at line 195 of file UriTest.cpp.

void Utils::Testing::UriTest::testNoEncodingScheme  )  [inline]
 

Definition at line 115 of file UriTest.cpp.

void Utils::Testing::UriTest::testNoEncodingSchemeWithAuthority  )  [inline]
 

Definition at line 127 of file UriTest.cpp.

void Utils::Testing::UriTest::testNoEncodingSchemeWithAuthorityWithFragment  )  [inline]
 

Definition at line 170 of file UriTest.cpp.

void Utils::Testing::UriTest::testNoEncodingSchemeWithAuthorityWithPath  )  [inline]
 

Definition at line 157 of file UriTest.cpp.

void Utils::Testing::UriTest::testNoEncodingSchemeWithAuthorityWithPathWithQueryWithFragment  )  [inline]
 

Definition at line 176 of file UriTest.cpp.

void Utils::Testing::UriTest::testNoEncodingSchemeWithAuthorityWithQuery  )  [inline]
 

Definition at line 164 of file UriTest.cpp.

void Utils::Testing::UriTest::testNoEncodingSchemeWithEmptyAuthority  )  [inline]
 

Definition at line 121 of file UriTest.cpp.

void Utils::Testing::UriTest::testNoEncodingSchemeWithEmptyAuthorityWithEmptyPathWithEmptyFragment  )  [inline]
 

Definition at line 139 of file UriTest.cpp.

void Utils::Testing::UriTest::testNoEncodingSchemeWithEmptyAuthorityWithEmptyPathWithEmptyQuery  )  [inline]
 

Definition at line 133 of file UriTest.cpp.

void Utils::Testing::UriTest::testNoEncodingSchemeWithEmptyAuthorityWithEmptyPathWithEmptyQueryWithEmptyFragment  )  [inline]
 

Definition at line 145 of file UriTest.cpp.

void Utils::Testing::UriTest::testNoEncodingSchemeWithEmptyAuthorityWithPath  )  [inline]
 

Definition at line 151 of file UriTest.cpp.

void Utils::Testing::UriTest::testParseEncodedUriQueryIsNotPrematurelyDecoded  )  [inline]
 

Definition at line 384 of file UriTest.cpp.

void Utils::Testing::UriTest::testParseQueryItemsFromEmptyQuery  )  [inline]
 

Definition at line 404 of file UriTest.cpp.

void Utils::Testing::UriTest::testParseQueryItemsFromQueryTwoItems  )  [inline]
 

Definition at line 394 of file UriTest.cpp.

void Utils::Testing::UriTest::testParseUnencodedProduceEncoded  )  [inline]
 

Definition at line 315 of file UriTest.cpp.

void Utils::Testing::UriTest::testParseUriWithoutQueryThenAppendQueryItemAFewTimes  )  [inline]
 

Definition at line 293 of file UriTest.cpp.

void Utils::Testing::UriTest::testParseUriWithoutQueryThenAppendQueryTwice  )  [inline]
 

Definition at line 245 of file UriTest.cpp.

void Utils::Testing::UriTest::testParseUriWithQueryThenAppendQueryItemAFewTimes  )  [inline]
 

Definition at line 304 of file UriTest.cpp.

void Utils::Testing::UriTest::testParseUriWithQueryThenAppendQueryTwice  )  [inline]
 

Definition at line 254 of file UriTest.cpp.

void Utils::Testing::UriTest::testParsingUriWithPortButWithoutHostFails  )  [inline]
 

"scheme://:80/" is invalid, parsing should result is Uri().

Definition at line 470 of file UriTest.cpp.

void Utils::Testing::UriTest::testParsingUriWithUserinfoAndPortButWithoutHostFails  )  [inline]
 

"scheme://userinfo@:80" is invalid, parsing should result is Uri().

Definition at line 484 of file UriTest.cpp.

void Utils::Testing::UriTest::testParsingUriWithUserinfoButWithoutHostFails  )  [inline]
 

"scheme://userinfo@/" is invalid, parsing should result is Uri().

Definition at line 477 of file UriTest.cpp.

void Utils::Testing::UriTest::testQueryItemValueNoneValueAssociated  )  [inline]
 

Verifies that QByteArray() will be returned when no value is associated.

Definition at line 449 of file UriTest.cpp.

void Utils::Testing::UriTest::testQueryItemValueOneValueAssociated  )  [inline]
 

Verifies that correct value will be returned if one value is associated.

Definition at line 456 of file UriTest.cpp.

void Utils::Testing::UriTest::testQueryItemValueTwoValuesAssociated  )  [inline]
 

Verifies that correct value will be returned if two values are associated.

Definition at line 463 of file UriTest.cpp.


Member Data Documentation

const QByteArray Utils::Testing::UriTest::validUriUnencoded1 [static, private]
 

Definition at line 78 of file UriTest.cpp.

const QByteArray Utils::Testing::UriTest::validUriUnencoded2 [static, private]
 

Definition at line 79 of file UriTest.cpp.


The documentation for this class was generated from the following file: