Kodi Documentation 23.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
TestURIUtils.cpp File Reference
#include "ServiceBroker.h"
#include "URL.h"
#include "Util.h"
#include "filesystem/DirectoryFactory.h"
#include "filesystem/File.h"
#include "filesystem/FileFactory.h"
#include "filesystem/IDirectory.h"
#include "filesystem/IFile.h"
#include "filesystem/MultiPathDirectory.h"
#include "interfaces/legacy/WindowInterceptor.h"
#include "settings/AdvancedSettings.h"
#include "settings/SettingsComponent.h"
#include "test/TestUtils.h"
#include "utils/URIUtils.h"
#include <array>
#include <memory>
#include <utility>
#include <gtest/gtest.h>

Classes

class  TestURIUtils
 
struct  TestPathData
 
class  TestParentPath
 
class  TestBasePath
 
struct  SanitiseUrlEncodingTestData
 
class  TestSanitiseUrlEncoding
 
struct  URLEncodings
 
struct  TestIsHostOnLANData
 
class  TestLANParamTest
 
struct  CURLArchiveConstructionTestData
 
class  ArchiveFileParsingTester
 
struct  GetFileOrFolderNameTest
 
class  GetFileOrFolderNameTester
 

Functions

 TEST_F (TestURIUtils, PathHasParent)
 
 TEST_F (TestURIUtils, RemoveDiscPath)
 
 TEST_F (TestURIUtils, GetDirectory)
 
 TEST_F (TestURIUtils, GetExtension)
 
 TEST_F (TestURIUtils, HasExtension)
 
 TEST_F (TestURIUtils, GetFileName)
 
 TEST_F (TestURIUtils, GetDecodedFileName)
 
 TEST_F (TestURIUtils, RemoveExtension)
 
 TEST_F (TestURIUtils, ReplaceExtension)
 
 TEST_F (TestURIUtils, Split)
 
 TEST_F (TestURIUtils, SplitPath)
 
 TEST_F (TestURIUtils, SplitPathLocal)
 
 TEST_F (TestURIUtils, GetCommonPath)
 
 TEST_P (TestParentPath, GetParentPath)
 
 INSTANTIATE_TEST_SUITE_P (ParentPath, TestParentPath, ValuesIn(Paths))
 
 TEST_P (TestBasePath, GetBasePath)
 
 INSTANTIATE_TEST_SUITE_P (BasePath, TestBasePath, ValuesIn(Paths))
 
 TEST_F (TestURIUtils, SubstitutePath)
 
 TEST_F (TestURIUtils, SubstitutePathPreservesExplicitIntent)
 
 TEST_F (TestURIUtils, SubstitutePathUsesReplacementIntent)
 
 TEST_F (TestURIUtils, IsAddonsPath)
 
 TEST_F (TestURIUtils, IsSourcesPath)
 
 TEST_F (TestURIUtils, IsCDDA)
 
 TEST_F (TestURIUtils, IsDOSPath)
 
 TEST_F (TestURIUtils, IsDVD)
 
 TEST_F (TestURIUtils, IsFTP)
 
 TEST_F (TestURIUtils, IsHD)
 
 TEST_F (TestURIUtils, IsInArchive)
 
 TEST_F (TestURIUtils, IsInRAR)
 
 TEST_F (TestURIUtils, IsInternetStream)
 
 TEST_F (TestURIUtils, IsInZIP)
 
 TEST_F (TestURIUtils, IsISO9660)
 
 TEST_F (TestURIUtils, IsLiveTV)
 
 TEST_F (TestURIUtils, IsPVRRadioChannel)
 
 TEST_F (TestURIUtils, IsMultiPath)
 
 TEST_F (TestURIUtils, IsMusicDb)
 
 TEST_F (TestURIUtils, IsNfs)
 
 TEST_F (TestURIUtils, IsOnDVD)
 
 TEST_F (TestURIUtils, IsOnLAN)
 
 TEST_F (TestURIUtils, IsPlugin)
 
 TEST_F (TestURIUtils, IsScript)
 
 TEST_F (TestURIUtils, IsRAR)
 
 TEST_F (TestURIUtils, IsRemote)
 
 TEST_F (TestURIUtils, IsSmb)
 
 TEST_F (TestURIUtils, IsSpecial)
 
 TEST_F (TestURIUtils, IsStack)
 
 TEST_F (TestURIUtils, IsUPnP)
 
 TEST_F (TestURIUtils, IsURL)
 
 TEST_F (TestURIUtils, IsVideoDb)
 
 TEST_F (TestURIUtils, IsZIP)
 
 TEST_F (TestURIUtils, IsBlurayPath)
 
 TEST_F (TestURIUtils, AddSlashAtEnd)
 
 TEST_F (TestURIUtils, HasSlashAtEnd)
 
 TEST_F (TestURIUtils, RemoveSlashAtEnd)
 
 TEST_F (TestURIUtils, CreateArchivePath)
 
 TEST_F (TestURIUtils, AddFileToFolder)
 
 TEST_F (TestURIUtils, RootlessURIParentAppendRoundTrip)
 
 TEST_F (TestURIUtils, AddFileToFolderMatchingEncodingEncodedFolder)
 
 TEST_F (TestURIUtils, AddFileToFolderMatchingEncodingSpecialCharacters)
 
 TEST_F (TestURIUtils, AddFileToFolderMatchingEncodingUnencodedFolder)
 
 TEST_F (TestURIUtils, HasParentInHostname)
 
 TEST_F (TestURIUtils, HasEncodedFilename)
 
 TEST_F (TestURIUtils, GetRealPath)
 
 TEST_P (TestSanitiseUrlEncoding, SanitiseUrlEncoding)
 
 INSTANTIATE_TEST_SUITE_P (SanitiseUrlEncoding, TestSanitiseUrlEncoding, ValuesIn(SanitiseUrlEncodingData))
 
 TEST_F (TestURIUtils, URLEncode)
 
 TEST_F (TestURIUtils, URLDecode)
 
 TEST_F (TestURIUtils, URLEncodeDecode)
 
 TEST_F (TestURIUtils, ContainersEncodeHostnamePaths)
 
 TEST_F (TestURIUtils, GetDiscBase)
 
 TEST_F (TestURIUtils, GetDiscBasePath)
 
 TEST_F (TestURIUtils, GetDiscFile)
 
 TEST_F (TestURIUtils, GetDiscUnderlyingFile)
 
 TEST_F (TestURIUtils, GetBlurayTitlesPath)
 
 TEST_F (TestURIUtils, GetBlurayEpisodePath)
 
 TEST_F (TestURIUtils, GetBlurayExtraTitlesPath)
 
 TEST_F (TestURIUtils, GetBlurayExtrasPath)
 
 TEST_F (TestURIUtils, GetBlurayPlaylistPath)
 
 TEST_F (TestURIUtils, GetBlurayPlaylistFromPath)
 
 TEST_F (TestURIUtils, RemovePartNumberFromTitle)
 
std::ostream & operator<< (std::ostream &os, const TestIsHostOnLANData &rhs)
 
 TEST_P (TestLANParamTest, TestIsHostOnLAN)
 
 INSTANTIATE_TEST_SUITE_P (TestURIUtils, TestLANParamTest, testing::ValuesIn(values))
 
 TEST_F (TestURIUtils, CheckConsistencyBetweenFileNameUtilities)
 
std::ostream & operator<< (std::ostream &os, const CURLArchiveConstructionTestData &data)
 
 TEST_P (ArchiveFileParsingTester, TestArchiveFileParsingNativeSlashes)
 
 INSTANTIATE_TEST_SUITE_P (TestURIUtils, ArchiveFileParsingTester, testing::ValuesIn(ArchiveFileParsingTests))
 
 TEST_P (GetFileOrFolderNameTester, TestValue)
 
 INSTANTIATE_TEST_SUITE_P (TestURIUtils, GetFileOrFolderNameTester, testing::ValuesIn(GetFileOrFolderNameTests))
 
 TEST_F (TestURIUtils, IsLocalOrLAN)
 
 TEST_F (TestURIUtils, GetDecodedPath)
 
 TEST_F (TestURIUtils, DecodePathEscapes)
 
 TEST_F (TestURIUtils, IdentifierPathOperationsHaveNoHierarchy)
 
 TEST_F (TestURIUtils, MagnetMemberNavigationPreservesIdentity)
 
 TEST_F (TestURIUtils, MagnetMemberAncestryPreservesIdentity)
 
 TEST_F (TestURIUtils, MagnetMemberAncestryPreservesComponentPresence)
 
 TEST_F (TestURIUtils, IdentifierPrefixesHaveNoAncestry)
 
 TEST_F (TestURIUtils, URIComponentsAreNotReparsedAsLocations)
 
 TEST_F (TestURIUtils, NativeColonFilenameExtensions)
 
 TEST_F (TestURIUtils, NativeColonPathOperations)
 
 TEST_F (TestURIUtils, NativeAndLegacyAncestryAndCommonPaths)
 
 TEST_F (TestURIUtils, CommonMagnetPathPreservesSharedIdentity)
 
 TEST_F (TestURIUtils, RootlessURIAncestryAndCommonPaths)
 
 TEST_F (TestURIUtils, ValidatePathPreservesAuthorityFreeURIBytes)
 
 TEST_F (TestURIUtils, DecodingPreservesAuthorityFreeURIBytes)
 
 TEST_F (TestURIUtils, SanitiseEncodingDistinguishesLegacyURLsFromIdentifiers)
 
 TEST_F (TestURIUtils, IdentifierFactoriesRespectSchemeSupport)
 
 TEST_F (TestURIUtils, ExplicitUnknownIdentifiersHaveNoFilesystemSemantics)
 
 TEST_F (TestURIUtils, LegacyDirectoryPreservesSourceAuthority)
 
 TEST_F (TestURIUtils, LegacyDirectoryRetainsProtocolFilenameDelimiters)
 
 TEST_F (TestURIUtils, SplitRetainsLegacyAdapterFilenames)
 
 TEST_F (TestURIUtils, SplitRetainsLegacyQuestionMarkTruncation)
 
 TEST_F (TestURIUtils, CustomVFSAndPlaylistNavigation)
 
 TEST_F (TestURIUtils, LosslessNavigationRetainsEmptyDelimitersAndEscapes)
 

Variables

const TestPathData Paths []
 
constexpr SanitiseUrlEncodingTestData SanitiseUrlEncodingData []
 
constexpr URLEncodings EncodingTestData []
 
constexpr URLEncodings RFC1738EncodingTestData []
 
constexpr URLEncodings RFC3986EncodingTestData []
 
constexpr URLEncodings InvalidEncodingTestData []
 
const TestIsHostOnLANData values []
 
const auto ArchiveFileParsingTests
 
const auto GetFileOrFolderNameTests
 

Function Documentation

◆ INSTANTIATE_TEST_SUITE_P() [1/6]

INSTANTIATE_TEST_SUITE_P ( BasePath ,
TestBasePath ,
ValuesIn(Paths)  )

◆ INSTANTIATE_TEST_SUITE_P() [2/6]

INSTANTIATE_TEST_SUITE_P ( ParentPath ,
TestParentPath ,
ValuesIn(Paths)  )

◆ INSTANTIATE_TEST_SUITE_P() [3/6]

INSTANTIATE_TEST_SUITE_P ( SanitiseUrlEncoding ,
TestSanitiseUrlEncoding ,
ValuesIn(SanitiseUrlEncodingData)  )

◆ INSTANTIATE_TEST_SUITE_P() [4/6]

INSTANTIATE_TEST_SUITE_P ( TestURIUtils ,
ArchiveFileParsingTester ,
testing::ValuesIn(ArchiveFileParsingTests)  )

◆ INSTANTIATE_TEST_SUITE_P() [5/6]

INSTANTIATE_TEST_SUITE_P ( TestURIUtils ,
GetFileOrFolderNameTester ,
testing::ValuesIn(GetFileOrFolderNameTests)  )

◆ INSTANTIATE_TEST_SUITE_P() [6/6]

INSTANTIATE_TEST_SUITE_P ( TestURIUtils ,
TestLANParamTest ,
testing::ValuesIn(values)  )

◆ operator<<() [1/2]

std::ostream & operator<< ( std::ostream & os,
const CURLArchiveConstructionTestData & data )

◆ operator<<() [2/2]

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

◆ TEST_F() [1/100]

TEST_F ( TestURIUtils ,
AddFileToFolder  )

◆ TEST_F() [2/100]

TEST_F ( TestURIUtils ,
AddFileToFolderMatchingEncodingEncodedFolder  )

◆ TEST_F() [3/100]

TEST_F ( TestURIUtils ,
AddFileToFolderMatchingEncodingSpecialCharacters  )

◆ TEST_F() [4/100]

TEST_F ( TestURIUtils ,
AddFileToFolderMatchingEncodingUnencodedFolder  )

◆ TEST_F() [5/100]

TEST_F ( TestURIUtils ,
AddSlashAtEnd  )

◆ TEST_F() [6/100]

TEST_F ( TestURIUtils ,
CheckConsistencyBetweenFileNameUtilities  )

◆ TEST_F() [7/100]

TEST_F ( TestURIUtils ,
CommonMagnetPathPreservesSharedIdentity  )

◆ TEST_F() [8/100]

TEST_F ( TestURIUtils ,
ContainersEncodeHostnamePaths  )

◆ TEST_F() [9/100]

TEST_F ( TestURIUtils ,
CreateArchivePath  )

◆ TEST_F() [10/100]

TEST_F ( TestURIUtils ,
CustomVFSAndPlaylistNavigation  )

◆ TEST_F() [11/100]

TEST_F ( TestURIUtils ,
DecodePathEscapes  )

◆ TEST_F() [12/100]

TEST_F ( TestURIUtils ,
DecodingPreservesAuthorityFreeURIBytes  )

◆ TEST_F() [13/100]

TEST_F ( TestURIUtils ,
ExplicitUnknownIdentifiersHaveNoFilesystemSemantics  )

◆ TEST_F() [14/100]

TEST_F ( TestURIUtils ,
GetBlurayEpisodePath  )

◆ TEST_F() [15/100]

TEST_F ( TestURIUtils ,
GetBlurayExtrasPath  )

◆ TEST_F() [16/100]

TEST_F ( TestURIUtils ,
GetBlurayExtraTitlesPath  )

◆ TEST_F() [17/100]

TEST_F ( TestURIUtils ,
GetBlurayPlaylistFromPath  )

◆ TEST_F() [18/100]

TEST_F ( TestURIUtils ,
GetBlurayPlaylistPath  )

◆ TEST_F() [19/100]

TEST_F ( TestURIUtils ,
GetBlurayTitlesPath  )

◆ TEST_F() [20/100]

TEST_F ( TestURIUtils ,
GetCommonPath  )

◆ TEST_F() [21/100]

TEST_F ( TestURIUtils ,
GetDecodedFileName  )

◆ TEST_F() [22/100]

TEST_F ( TestURIUtils ,
GetDecodedPath  )

◆ TEST_F() [23/100]

TEST_F ( TestURIUtils ,
GetDirectory  )

◆ TEST_F() [24/100]

TEST_F ( TestURIUtils ,
GetDiscBase  )

◆ TEST_F() [25/100]

TEST_F ( TestURIUtils ,
GetDiscBasePath  )

◆ TEST_F() [26/100]

TEST_F ( TestURIUtils ,
GetDiscFile  )

◆ TEST_F() [27/100]

TEST_F ( TestURIUtils ,
GetDiscUnderlyingFile  )

◆ TEST_F() [28/100]

TEST_F ( TestURIUtils ,
GetExtension  )

◆ TEST_F() [29/100]

TEST_F ( TestURIUtils ,
GetFileName  )

◆ TEST_F() [30/100]

TEST_F ( TestURIUtils ,
GetRealPath  )

◆ TEST_F() [31/100]

TEST_F ( TestURIUtils ,
HasEncodedFilename  )

◆ TEST_F() [32/100]

TEST_F ( TestURIUtils ,
HasExtension  )

◆ TEST_F() [33/100]

TEST_F ( TestURIUtils ,
HasParentInHostname  )

◆ TEST_F() [34/100]

TEST_F ( TestURIUtils ,
HasSlashAtEnd  )

◆ TEST_F() [35/100]

TEST_F ( TestURIUtils ,
IdentifierFactoriesRespectSchemeSupport  )

◆ TEST_F() [36/100]

TEST_F ( TestURIUtils ,
IdentifierPathOperationsHaveNoHierarchy  )

◆ TEST_F() [37/100]

TEST_F ( TestURIUtils ,
IdentifierPrefixesHaveNoAncestry  )

◆ TEST_F() [38/100]

TEST_F ( TestURIUtils ,
IsAddonsPath  )

◆ TEST_F() [39/100]

TEST_F ( TestURIUtils ,
IsBlurayPath  )

◆ TEST_F() [40/100]

TEST_F ( TestURIUtils ,
IsCDDA  )

◆ TEST_F() [41/100]

TEST_F ( TestURIUtils ,
IsDOSPath  )

◆ TEST_F() [42/100]

TEST_F ( TestURIUtils ,
IsDVD  )

◆ TEST_F() [43/100]

TEST_F ( TestURIUtils ,
IsFTP  )

◆ TEST_F() [44/100]

TEST_F ( TestURIUtils ,
IsHD  )

◆ TEST_F() [45/100]

TEST_F ( TestURIUtils ,
IsInArchive  )

◆ TEST_F() [46/100]

TEST_F ( TestURIUtils ,
IsInRAR  )

◆ TEST_F() [47/100]

TEST_F ( TestURIUtils ,
IsInternetStream  )

◆ TEST_F() [48/100]

TEST_F ( TestURIUtils ,
IsInZIP  )

◆ TEST_F() [49/100]

TEST_F ( TestURIUtils ,
IsISO9660  )

◆ TEST_F() [50/100]

TEST_F ( TestURIUtils ,
IsLiveTV  )

◆ TEST_F() [51/100]

TEST_F ( TestURIUtils ,
IsLocalOrLAN  )

◆ TEST_F() [52/100]

TEST_F ( TestURIUtils ,
IsMultiPath  )

◆ TEST_F() [53/100]

TEST_F ( TestURIUtils ,
IsMusicDb  )

◆ TEST_F() [54/100]

TEST_F ( TestURIUtils ,
IsNfs  )

◆ TEST_F() [55/100]

TEST_F ( TestURIUtils ,
IsOnDVD  )

◆ TEST_F() [56/100]

TEST_F ( TestURIUtils ,
IsOnLAN  )

◆ TEST_F() [57/100]

TEST_F ( TestURIUtils ,
IsPlugin  )

◆ TEST_F() [58/100]

TEST_F ( TestURIUtils ,
IsPVRRadioChannel  )

◆ TEST_F() [59/100]

TEST_F ( TestURIUtils ,
IsRAR  )

◆ TEST_F() [60/100]

TEST_F ( TestURIUtils ,
IsRemote  )

◆ TEST_F() [61/100]

TEST_F ( TestURIUtils ,
IsScript  )

◆ TEST_F() [62/100]

TEST_F ( TestURIUtils ,
IsSmb  )

◆ TEST_F() [63/100]

TEST_F ( TestURIUtils ,
IsSourcesPath  )

◆ TEST_F() [64/100]

TEST_F ( TestURIUtils ,
IsSpecial  )

◆ TEST_F() [65/100]

TEST_F ( TestURIUtils ,
IsStack  )

◆ TEST_F() [66/100]

TEST_F ( TestURIUtils ,
IsUPnP  )

◆ TEST_F() [67/100]

TEST_F ( TestURIUtils ,
IsURL  )

◆ TEST_F() [68/100]

TEST_F ( TestURIUtils ,
IsVideoDb  )

◆ TEST_F() [69/100]

TEST_F ( TestURIUtils ,
IsZIP  )

◆ TEST_F() [70/100]

TEST_F ( TestURIUtils ,
LegacyDirectoryPreservesSourceAuthority  )

◆ TEST_F() [71/100]

TEST_F ( TestURIUtils ,
LegacyDirectoryRetainsProtocolFilenameDelimiters  )

◆ TEST_F() [72/100]

TEST_F ( TestURIUtils ,
LosslessNavigationRetainsEmptyDelimitersAndEscapes  )

◆ TEST_F() [73/100]

TEST_F ( TestURIUtils ,
MagnetMemberAncestryPreservesComponentPresence  )

◆ TEST_F() [74/100]

TEST_F ( TestURIUtils ,
MagnetMemberAncestryPreservesIdentity  )

◆ TEST_F() [75/100]

TEST_F ( TestURIUtils ,
MagnetMemberNavigationPreservesIdentity  )

◆ TEST_F() [76/100]

TEST_F ( TestURIUtils ,
NativeAndLegacyAncestryAndCommonPaths  )

◆ TEST_F() [77/100]

TEST_F ( TestURIUtils ,
NativeColonFilenameExtensions  )

◆ TEST_F() [78/100]

TEST_F ( TestURIUtils ,
NativeColonPathOperations  )

◆ TEST_F() [79/100]

TEST_F ( TestURIUtils ,
PathHasParent  )

◆ TEST_F() [80/100]

TEST_F ( TestURIUtils ,
RemoveDiscPath  )

◆ TEST_F() [81/100]

TEST_F ( TestURIUtils ,
RemoveExtension  )

◆ TEST_F() [82/100]

TEST_F ( TestURIUtils ,
RemovePartNumberFromTitle  )

◆ TEST_F() [83/100]

TEST_F ( TestURIUtils ,
RemoveSlashAtEnd  )

◆ TEST_F() [84/100]

TEST_F ( TestURIUtils ,
ReplaceExtension  )

◆ TEST_F() [85/100]

TEST_F ( TestURIUtils ,
RootlessURIAncestryAndCommonPaths  )

◆ TEST_F() [86/100]

TEST_F ( TestURIUtils ,
RootlessURIParentAppendRoundTrip  )

◆ TEST_F() [87/100]

TEST_F ( TestURIUtils ,
SanitiseEncodingDistinguishesLegacyURLsFromIdentifiers  )

◆ TEST_F() [88/100]

TEST_F ( TestURIUtils ,
Split  )

◆ TEST_F() [89/100]

TEST_F ( TestURIUtils ,
SplitPath  )

◆ TEST_F() [90/100]

TEST_F ( TestURIUtils ,
SplitPathLocal  )

◆ TEST_F() [91/100]

TEST_F ( TestURIUtils ,
SplitRetainsLegacyAdapterFilenames  )

◆ TEST_F() [92/100]

TEST_F ( TestURIUtils ,
SplitRetainsLegacyQuestionMarkTruncation  )

◆ TEST_F() [93/100]

TEST_F ( TestURIUtils ,
SubstitutePath  )

◆ TEST_F() [94/100]

TEST_F ( TestURIUtils ,
SubstitutePathPreservesExplicitIntent  )

◆ TEST_F() [95/100]

TEST_F ( TestURIUtils ,
SubstitutePathUsesReplacementIntent  )

◆ TEST_F() [96/100]

TEST_F ( TestURIUtils ,
URIComponentsAreNotReparsedAsLocations  )

◆ TEST_F() [97/100]

TEST_F ( TestURIUtils ,
URLDecode  )

◆ TEST_F() [98/100]

TEST_F ( TestURIUtils ,
URLEncode  )

◆ TEST_F() [99/100]

TEST_F ( TestURIUtils ,
URLEncodeDecode  )

◆ TEST_F() [100/100]

TEST_F ( TestURIUtils ,
ValidatePathPreservesAuthorityFreeURIBytes  )

◆ TEST_P() [1/6]

TEST_P ( ArchiveFileParsingTester ,
TestArchiveFileParsingNativeSlashes  )

◆ TEST_P() [2/6]

TEST_P ( GetFileOrFolderNameTester ,
TestValue  )

◆ TEST_P() [3/6]

TEST_P ( TestBasePath ,
GetBasePath  )

◆ TEST_P() [4/6]

TEST_P ( TestLANParamTest ,
TestIsHostOnLAN  )

◆ TEST_P() [5/6]

TEST_P ( TestParentPath ,
GetParentPath  )

◆ TEST_P() [6/6]

TEST_P ( TestSanitiseUrlEncoding ,
SanitiseUrlEncoding  )

Variable Documentation

◆ ArchiveFileParsingTests

const auto ArchiveFileParsingTests

◆ EncodingTestData

URLEncodings EncodingTestData[]
constexpr

◆ GetFileOrFolderNameTests

const auto GetFileOrFolderNameTests
Initial value:
= std::array{
GetFileOrFolderNameTest{"foo", "foo"},
GetFileOrFolderNameTest{"foo/bar", "bar"},
GetFileOrFolderNameTest{"foo/bar/", "bar"},
GetFileOrFolderNameTest{"foo/", "foo"},
GetFileOrFolderNameTest{"/foo", "foo"},
GetFileOrFolderNameTest{"/foo/", "foo"},
GetFileOrFolderNameTest{"foo\\bar", "bar"},
GetFileOrFolderNameTest{"foo\\bar\\", "bar"},
GetFileOrFolderNameTest{"foo\\", "foo"},
GetFileOrFolderNameTest{"\\foo\\", "foo"},
GetFileOrFolderNameTest{"\\foo", "foo"},
GetFileOrFolderNameTest{"smb://server/", "server"},
GetFileOrFolderNameTest{"plugin://plugin.video.foo/", "plugin.video.foo"},
GetFileOrFolderNameTest{"file:/videos/?x=1#part", "videos"},
GetFileOrFolderNameTest{"file:/", ""},
GetFileOrFolderNameTest{"urn:example:folder/", ""},
}
Definition TestURIUtils.cpp:2751

◆ InvalidEncodingTestData

URLEncodings InvalidEncodingTestData[]
constexpr
Initial value:
= {
{"%", "%"},
{"%%", "%%"},
{"%;", "%;"},
{"%-", "%-"},
{"%2", "%2"},
{"%2-", "%2-"},
{"%2x", "%2x"},
{"% ", "%%20"},
{"%% ", "%%%20"},
{"%; ", "%;%20"},
{"%- ", "%-%20"},
{"%2 ", "%2%20"},
{"%2- ", "%2-%20"},
{"%2x ", "%2x%20"},
}

◆ Paths

const TestPathData Paths[]

◆ RFC1738EncodingTestData

URLEncodings RFC1738EncodingTestData[]
constexpr
Initial value:
= {
{"-", "-"}, {"_", "_"}, {".", "."}, {"!", "!"}, {"(", "("}, {")", ")"}, {"~", "%7e"},
}

◆ RFC3986EncodingTestData

URLEncodings RFC3986EncodingTestData[]
constexpr
Initial value:
= {
{"-", "-"}, {"_", "_"}, {".", "."}, {"!", "%21"}, {"(", "%28"}, {")", "%29"}, {"~", "~"},
}

◆ SanitiseUrlEncodingData

SanitiseUrlEncodingTestData SanitiseUrlEncodingData[]
constexpr

◆ values

const TestIsHostOnLANData values[]
Initial value:
= {
{ true, false, true, false, "localhost" },
{ true, true, true, true, "some_unresolveable_hostname" },
{ true, true, true, true, "google" },
{ true, true, true, true, "aol" },
{ false, false, false, false, "www.some_unresolveable_hostname.com" },
{ false, false, false, false, "www.google.com" },
{ false, false, false, false, "google.com" },
{ false, false, false, false, "www.aol.com" },
{ false, false, false, false, "aol.com" },
{ false, false, false, false, "168.219.34.129" },
{ false, false, false, false, "0.0.0.0" },
{ false, false, false, false, "127.0.0.1" },
{ true, true, false, false, "192.168.0.3", TestIsHostOnLANData::DONT_TEST_LOCAL_NETWORK },
{ true, true, true, true, "172.16.0.2", TestIsHostOnLANData::DONT_TEST_LOCAL_NETWORK },
{ true, true, false, false, "10.0.0.9", TestIsHostOnLANData::DONT_TEST_LOCAL_NETWORK },
}
static const bool DONT_TEST_LOCAL_NETWORK
Definition TestURIUtils.cpp:2451