Kodi Documentation 23.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
TestURL.cpp File Reference
#include "URL.h"
#include "filesystem/StackDirectory.h"
#include "utils/URIUtils.h"
#include <gtest/gtest.h>

Classes

class  TestCURL
 
struct  TestURLGetWithoutUserDetailsData
 
class  TestURLGetWithoutUserDetails
 
struct  TestNFSURLParsingData
 
class  TestNFSURLParsing
 

Functions

 TEST_F (TestCURL, TestComparison)
 
std::ostream & operator<< (std::ostream &os, const TestURLGetWithoutUserDetailsData &rhs)
 
 TEST_P (TestURLGetWithoutUserDetails, GetWithoutUserDetails)
 
 INSTANTIATE_TEST_SUITE_P (URL, TestURLGetWithoutUserDetails, ValuesIn(values))
 
 TEST (TestURLGetWithoutOptions, PreserveSlashesBetweenProtocolAndPath)
 
 TEST (TestURL, TestWithoutFilenameEncodingDecoding)
 
 TEST_F (TestCURL, TestPaths)
 
 TEST_F (TestCURL, TestExtensions)
 
 TEST_F (TestCURL, TestNFSURLWithOptions)
 
 TEST_F (TestCURL, TestNFSURLWithoutOptions)
 
 TEST_F (TestCURL, TestNFSURLWithPort)
 
 TEST_F (TestCURL, TestNFSURLWithPortAndOptions)
 
 TEST_F (TestCURL, TestNFSURLMultipleOptions)
 
 TEST_F (TestCURL, TestNFSURLWithSpecialCharacters)
 
 TEST_F (TestCURL, TestNFSURLReconstructed)
 
 TEST_F (TestCURL, TestNFSURLWithIPv6)
 
 TEST_F (TestCURL, TestNFSURLGetWithoutUserDetails)
 
 TEST_F (TestCURL, TestNFSURLGetWithoutOptions)
 
std::ostream & operator<< (std::ostream &os, const TestNFSURLParsingData &rhs)
 
 TEST_P (TestNFSURLParsing, ParseNFSURL)
 
 INSTANTIATE_TEST_SUITE_P (NFSParsing, TestNFSURLParsing, ValuesIn(nfsParsingData))
 
 TEST_F (TestCURL, FoundationCompatibility)
 
 TEST_F (TestCURL, FoundationLegacyOptionsAndReparse)
 
 TEST_F (TestCURL, IdentifierRecognitionBeforeNormalization)
 
 TEST_F (TestCURL, LosslessIdentifiers)
 
 TEST_F (TestCURL, RawComponentsAndSchemeSpecificPart)
 
 TEST_F (TestCURL, SchemeSpecificPartView)
 
 TEST_F (TestCURL, ExplicitAndMixedInputIntent)
 
 TEST_F (TestCURL, NativeColonFilenames)
 
 TEST_F (TestCURL, UnknownIdentifiersRequireExplicitURIIntent)
 
 TEST_F (TestCURL, LosslessMemberMutation)
 
 TEST_F (TestCURL, URIPathMutationUsesAuthorityContext)
 
 TEST_F (TestCURL, URIPathMutationRejectsComponentChanges)
 
 TEST_F (TestCURL, FileNameSetterUsesURIPathAuthorityContext)
 
 TEST_F (TestCURL, LosslessStateTransitions)
 
 TEST_F (TestCURL, BoundedDataRedaction)
 
 TEST_F (TestCURL, ExplicitSchemeSetterTransitions)
 
 TEST_F (TestCURL, DriveRelativeFilename)
 
 TEST_F (TestCURL, MovedFromURIHasNoStaleComponents)
 
 TEST_F (TestCURL, PathSettersDoNotRepairMalformedCandidates)
 
 TEST_F (TestCURL, URIPathComponentsDoNotHaveNativeDrives)
 
 TEST_F (TestCURL, LegacyProtocolToNativeClearsURIState)
 
 TEST_F (TestCURL, SacdVFSCompatibilityProjection)
 
 TEST_F (TestCURL, ExistingVFSCompatibilityProjections)
 
 TEST_F (TestCURL, RedactDataThroughResourceWrappers)
 
 TEST_F (TestCURL, WrappedDataRedactionIsBounded)
 
 TEST_F (TestCURL, RedactDataThroughNestedStackEscapes)
 
 TEST_F (TestCURL, RedactDataThroughLegacyWrapperSeparators)
 
 TEST_F (TestCURL, RedactionRespectsStackMemberBoundaries)
 
 TEST_F (TestCURL, ResourceRedactionPreservesOtherLegacyBehavior)
 
 TEST_F (TestCURL, CustomVFSProtocolsRetainLegacyProjection)
 
 TEST_F (TestCURL, OneLetterVFSProtocolsRetainLegacyProjection)
 
 TEST_F (TestCURL, AuthorityFreeFileURIsAreLocal)
 
 TEST_F (TestCURL, OneLetterVFSProtocolsSupportLegacyConstruction)
 
 TEST_F (TestCURL, ExplicitUnknownURIRetainsLosslessIntent)
 
 TEST_F (TestCURL, PlaylistProtocolsRetainLegacySemantics)
 
 TEST_F (TestCURL, RedactCredentialsThroughImageWrappers)
 
 TEST_F (TestCURL, ExplicitWrappersRemoveNestedCredentials)
 
 TEST_F (TestCURL, ExplicitCredentialFreeWrappersPreserveSpelling)
 
 TEST_F (TestCURL, OneLetterSchemeTransitionsPreserveRepresentation)
 
 TEST_F (TestCURL, LargeDataInEncodedStackRedactsWithoutChangingResource)
 

Variables

const TestURLGetWithoutUserDetailsData values []
 
const TestNFSURLParsingData nfsParsingData []
 

Function Documentation

◆ INSTANTIATE_TEST_SUITE_P() [1/2]

INSTANTIATE_TEST_SUITE_P ( NFSParsing ,
TestNFSURLParsing ,
ValuesIn(nfsParsingData)  )

◆ INSTANTIATE_TEST_SUITE_P() [2/2]

INSTANTIATE_TEST_SUITE_P ( URL ,
TestURLGetWithoutUserDetails ,
ValuesIn(values)  )

◆ operator<<() [1/2]

std::ostream & operator<< ( std::ostream & os,
const TestNFSURLParsingData & rhs )

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream & os,
const TestURLGetWithoutUserDetailsData & rhs )

◆ TEST() [1/2]

TEST ( TestURL ,
TestWithoutFilenameEncodingDecoding  )

◆ TEST() [2/2]

TEST ( TestURLGetWithoutOptions ,
PreserveSlashesBetweenProtocolAndPath  )

◆ TEST_F() [1/53]

TEST_F ( TestCURL ,
AuthorityFreeFileURIsAreLocal  )

◆ TEST_F() [2/53]

TEST_F ( TestCURL ,
BoundedDataRedaction  )

◆ TEST_F() [3/53]

TEST_F ( TestCURL ,
CustomVFSProtocolsRetainLegacyProjection  )

◆ TEST_F() [4/53]

TEST_F ( TestCURL ,
DriveRelativeFilename  )

◆ TEST_F() [5/53]

TEST_F ( TestCURL ,
ExistingVFSCompatibilityProjections  )

◆ TEST_F() [6/53]

TEST_F ( TestCURL ,
ExplicitAndMixedInputIntent  )

◆ TEST_F() [7/53]

TEST_F ( TestCURL ,
ExplicitCredentialFreeWrappersPreserveSpelling  )

◆ TEST_F() [8/53]

TEST_F ( TestCURL ,
ExplicitSchemeSetterTransitions  )

◆ TEST_F() [9/53]

TEST_F ( TestCURL ,
ExplicitUnknownURIRetainsLosslessIntent  )

◆ TEST_F() [10/53]

TEST_F ( TestCURL ,
ExplicitWrappersRemoveNestedCredentials  )

◆ TEST_F() [11/53]

TEST_F ( TestCURL ,
FileNameSetterUsesURIPathAuthorityContext  )

◆ TEST_F() [12/53]

TEST_F ( TestCURL ,
FoundationCompatibility  )

◆ TEST_F() [13/53]

TEST_F ( TestCURL ,
FoundationLegacyOptionsAndReparse  )

◆ TEST_F() [14/53]

TEST_F ( TestCURL ,
IdentifierRecognitionBeforeNormalization  )

◆ TEST_F() [15/53]

TEST_F ( TestCURL ,
LargeDataInEncodedStackRedactsWithoutChangingResource  )

◆ TEST_F() [16/53]

TEST_F ( TestCURL ,
LegacyProtocolToNativeClearsURIState  )

◆ TEST_F() [17/53]

TEST_F ( TestCURL ,
LosslessIdentifiers  )

◆ TEST_F() [18/53]

TEST_F ( TestCURL ,
LosslessMemberMutation  )

◆ TEST_F() [19/53]

TEST_F ( TestCURL ,
LosslessStateTransitions  )

◆ TEST_F() [20/53]

TEST_F ( TestCURL ,
MovedFromURIHasNoStaleComponents  )

◆ TEST_F() [21/53]

TEST_F ( TestCURL ,
NativeColonFilenames  )

◆ TEST_F() [22/53]

TEST_F ( TestCURL ,
OneLetterSchemeTransitionsPreserveRepresentation  )

◆ TEST_F() [23/53]

TEST_F ( TestCURL ,
OneLetterVFSProtocolsRetainLegacyProjection  )

◆ TEST_F() [24/53]

TEST_F ( TestCURL ,
OneLetterVFSProtocolsSupportLegacyConstruction  )

◆ TEST_F() [25/53]

TEST_F ( TestCURL ,
PathSettersDoNotRepairMalformedCandidates  )

◆ TEST_F() [26/53]

TEST_F ( TestCURL ,
PlaylistProtocolsRetainLegacySemantics  )

◆ TEST_F() [27/53]

TEST_F ( TestCURL ,
RawComponentsAndSchemeSpecificPart  )

◆ TEST_F() [28/53]

TEST_F ( TestCURL ,
RedactCredentialsThroughImageWrappers  )

◆ TEST_F() [29/53]

TEST_F ( TestCURL ,
RedactDataThroughLegacyWrapperSeparators  )

◆ TEST_F() [30/53]

TEST_F ( TestCURL ,
RedactDataThroughNestedStackEscapes  )

◆ TEST_F() [31/53]

TEST_F ( TestCURL ,
RedactDataThroughResourceWrappers  )

◆ TEST_F() [32/53]

TEST_F ( TestCURL ,
RedactionRespectsStackMemberBoundaries  )

◆ TEST_F() [33/53]

TEST_F ( TestCURL ,
ResourceRedactionPreservesOtherLegacyBehavior  )

◆ TEST_F() [34/53]

TEST_F ( TestCURL ,
SacdVFSCompatibilityProjection  )

◆ TEST_F() [35/53]

TEST_F ( TestCURL ,
SchemeSpecificPartView  )

◆ TEST_F() [36/53]

TEST_F ( TestCURL ,
TestComparison  )

◆ TEST_F() [37/53]

TEST_F ( TestCURL ,
TestExtensions  )

◆ TEST_F() [38/53]

TEST_F ( TestCURL ,
TestNFSURLGetWithoutOptions  )

◆ TEST_F() [39/53]

TEST_F ( TestCURL ,
TestNFSURLGetWithoutUserDetails  )

◆ TEST_F() [40/53]

TEST_F ( TestCURL ,
TestNFSURLMultipleOptions  )

◆ TEST_F() [41/53]

TEST_F ( TestCURL ,
TestNFSURLReconstructed  )

◆ TEST_F() [42/53]

TEST_F ( TestCURL ,
TestNFSURLWithIPv6  )

◆ TEST_F() [43/53]

TEST_F ( TestCURL ,
TestNFSURLWithOptions  )

◆ TEST_F() [44/53]

TEST_F ( TestCURL ,
TestNFSURLWithoutOptions  )

◆ TEST_F() [45/53]

TEST_F ( TestCURL ,
TestNFSURLWithPort  )

◆ TEST_F() [46/53]

TEST_F ( TestCURL ,
TestNFSURLWithPortAndOptions  )

◆ TEST_F() [47/53]

TEST_F ( TestCURL ,
TestNFSURLWithSpecialCharacters  )

◆ TEST_F() [48/53]

TEST_F ( TestCURL ,
TestPaths  )

◆ TEST_F() [49/53]

TEST_F ( TestCURL ,
UnknownIdentifiersRequireExplicitURIIntent  )

◆ TEST_F() [50/53]

TEST_F ( TestCURL ,
URIPathComponentsDoNotHaveNativeDrives  )

◆ TEST_F() [51/53]

TEST_F ( TestCURL ,
URIPathMutationRejectsComponentChanges  )

◆ TEST_F() [52/53]

TEST_F ( TestCURL ,
URIPathMutationUsesAuthorityContext  )

◆ TEST_F() [53/53]

TEST_F ( TestCURL ,
WrappedDataRedactionIsBounded  )

◆ TEST_P() [1/2]

TEST_P ( TestNFSURLParsing ,
ParseNFSURL  )

◆ TEST_P() [2/2]

TEST_P ( TestURLGetWithoutUserDetails ,
GetWithoutUserDetails  )

Variable Documentation

◆ nfsParsingData

const TestNFSURLParsingData nfsParsingData[]
Initial value:
= {
{"nfs://192.168.178.23/share/file.mkv?mimetype=video%2fx-matroska", "nfs", "192.168.178.23",
"share/file.mkv", "?mimetype=video%2fx-matroska", "mkv"},
{"nfs://192.168.1.1/export/path/video.mp4", "nfs", "192.168.1.1", "export/path/video.mp4", "",
"mp4"},
{"nfs://10.0.0.5:2049/data/movie.avi?timeout=30", "nfs", "10.0.0.5", "data/movie.avi",
"?timeout=30", "avi"},
{"nfs://server.local/nfs/files.iso?mimetype=application%2fx-iso9660-image&version=1", "nfs",
"server.local", "nfs/files.iso", "?mimetype=application%2fx-iso9660-image&version=1", "iso"},
{"nfs://192.168.1.100/Public/My%20Videos/Movie%202020.mkv?type=video", "nfs", "192.168.1.100",
"Public/My%20Videos/Movie%202020.mkv", "?type=video", "mkv"},
{"nfs://192.168.178.23/share/#recently-added/movie.mkv", "nfs", "192.168.178.23",
"share/#recently-added/movie.mkv", "", "mkv"},
{"nfs://192.168.178.23/share/Comedy;Drama/movie.mkv", "nfs", "192.168.178.23",
"share/Comedy;Drama/movie.mkv", "", "mkv"},
}

◆ values

Initial value:
= {
{ std::string("smb://example.com/example"), std::string("smb://example.com/example"), false },
{ std::string("smb://example.com/example"), std::string("smb://example.com/example"), true },
{ std::string("smb://god:universe@example.com/example"), std::string("smb://example.com/example"), false },
{ std::string("smb://god@example.com/example"), std::string("smb://USERNAME@example.com/example"), true },
{ std::string("smb://god:universe@example.com/example"), std::string("smb://USERNAME:PASSWORD@example.com/example"), true },
{ std::string("http://god:universe@example.com:8448/example|auth=digest"), std::string("http://USERNAME:PASSWORD@example.com:8448/example|auth=digest"), true },
{ std::string("smb://fd00::1/example"), std::string("smb://fd00::1/example"), false },
{ std::string("smb://fd00::1/example"), std::string("smb://fd00::1/example"), true },
{ std::string("smb://[fd00::1]:8080/example"), std::string("smb://[fd00::1]:8080/example"), false },
{ std::string("smb://[fd00::1]:8080/example"), std::string("smb://[fd00::1]:8080/example"), true },
{ std::string("smb://god:universe@[fd00::1]:8080/example"), std::string("smb://[fd00::1]:8080/example"), false },
{ std::string("smb://god@[fd00::1]:8080/example"), std::string("smb://USERNAME@[fd00::1]:8080/example"), true },
{ std::string("smb://god:universe@fd00::1/example"), std::string("smb://USERNAME:PASSWORD@fd00::1/example"), true },
{ std::string("http://god:universe@[fd00::1]:8448/example|auth=digest"), std::string("http://USERNAME:PASSWORD@[fd00::1]:8448/example|auth=digest"), true },
{ std::string("smb://00ff:1:0000:abde::/example"), std::string("smb://00ff:1:0000:abde::/example"), true },
{ std::string("smb://god:universe@[00ff:1:0000:abde::]:8080/example"), std::string("smb://[00ff:1:0000:abde::]:8080/example"), false },
{ std::string("smb://god@[00ff:1:0000:abde::]:8080/example"), std::string("smb://USERNAME@[00ff:1:0000:abde::]:8080/example"), true },
{ std::string("smb://god:universe@00ff:1:0000:abde::/example"), std::string("smb://USERNAME:PASSWORD@00ff:1:0000:abde::/example"), true },
{ std::string("http://god:universe@[00ff:1:0000:abde::]:8448/example|auth=digest"), std::string("http://USERNAME:PASSWORD@[00ff:1:0000:abde::]:8448/example|auth=digest"), true },
{ std::string("smb://milkyway;god:universe@example.com/example"), std::string("smb://DOMAIN;USERNAME:PASSWORD@example.com/example"), true },
{ std::string("smb://milkyway;god@example.com/example"), std::string("smb://DOMAIN;USERNAME@example.com/example"), true },
{ std::string("smb://milkyway;@example.com/example"), std::string("smb://example.com/example"), true },
{ std::string("smb://milkyway;god:universe@example.com/example"), std::string("smb://example.com/example"), false },
{ std::string("smb://milkyway;god@example.com/example"), std::string("smb://example.com/example"), false },
{ std::string("smb://milkyway;@example.com/example"), std::string("smb://example.com/example"), false },
}