Kodi Documentation 22.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 "filesystem/MultiPathDirectory.h"
#include "settings/AdvancedSettings.h"
#include "settings/SettingsComponent.h"
#include "utils/URIUtils.h"
#include <utility>
#include <gtest/gtest.h>

Classes

class  TestURIUtils
 
struct  URLEncodings
 
struct  TestIsHostOnLANData
 
class  TestLANParamTest
 

Functions

 TEST_F (TestURIUtils, PathHasParent)
 
 TEST_F (TestURIUtils, GetDirectory)
 
 TEST_F (TestURIUtils, GetExtension)
 
 TEST_F (TestURIUtils, HasExtension)
 
 TEST_F (TestURIUtils, GetFileName)
 
 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_F (TestURIUtils, GetParentPath)
 
 TEST_F (TestURIUtils, GetBasePath)
 
 TEST_F (TestURIUtils, SubstitutePath)
 
 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, HasParentInHostname)
 
 TEST_F (TestURIUtils, HasEncodedHostname)
 
 TEST_F (TestURIUtils, HasEncodedFilename)
 
 TEST_F (TestURIUtils, GetRealPath)
 
 TEST_F (TestURIUtils, UpdateUrlEncoding)
 
 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, GetBlurayRootPath)
 
 TEST_F (TestURIUtils, GetBlurayEpisodePath)
 
 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)
 

Variables

constexpr URLEncodings EncodingTestData []
 
constexpr URLEncodings RFC1738EncodingTestData []
 
constexpr URLEncodings RFC3986EncodingTestData []
 
constexpr URLEncodings InvalidEncodingTestData []
 
const TestIsHostOnLANData values []
 

Function Documentation

◆ INSTANTIATE_TEST_SUITE_P()

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

◆ operator<<()

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

◆ TEST_F() [1/69]

TEST_F ( TestURIUtils  ,
AddFileToFolder   
)

◆ TEST_F() [2/69]

TEST_F ( TestURIUtils  ,
AddSlashAtEnd   
)

◆ TEST_F() [3/69]

TEST_F ( TestURIUtils  ,
CheckConsistencyBetweenFileNameUtilities   
)

◆ TEST_F() [4/69]

TEST_F ( TestURIUtils  ,
ContainersEncodeHostnamePaths   
)

◆ TEST_F() [5/69]

TEST_F ( TestURIUtils  ,
CreateArchivePath   
)

◆ TEST_F() [6/69]

TEST_F ( TestURIUtils  ,
GetBasePath   
)

◆ TEST_F() [7/69]

TEST_F ( TestURIUtils  ,
GetBlurayEpisodePath   
)

◆ TEST_F() [8/69]

TEST_F ( TestURIUtils  ,
GetBlurayPlaylistFromPath   
)

◆ TEST_F() [9/69]

TEST_F ( TestURIUtils  ,
GetBlurayPlaylistPath   
)

◆ TEST_F() [10/69]

TEST_F ( TestURIUtils  ,
GetBlurayRootPath   
)

◆ TEST_F() [11/69]

TEST_F ( TestURIUtils  ,
GetCommonPath   
)

◆ TEST_F() [12/69]

TEST_F ( TestURIUtils  ,
GetDirectory   
)

◆ TEST_F() [13/69]

TEST_F ( TestURIUtils  ,
GetDiscBase   
)

◆ TEST_F() [14/69]

TEST_F ( TestURIUtils  ,
GetDiscBasePath   
)

◆ TEST_F() [15/69]

TEST_F ( TestURIUtils  ,
GetDiscFile   
)

◆ TEST_F() [16/69]

TEST_F ( TestURIUtils  ,
GetDiscUnderlyingFile   
)

◆ TEST_F() [17/69]

TEST_F ( TestURIUtils  ,
GetExtension   
)

◆ TEST_F() [18/69]

TEST_F ( TestURIUtils  ,
GetFileName   
)

◆ TEST_F() [19/69]

TEST_F ( TestURIUtils  ,
GetParentPath   
)

◆ TEST_F() [20/69]

TEST_F ( TestURIUtils  ,
GetRealPath   
)

◆ TEST_F() [21/69]

TEST_F ( TestURIUtils  ,
HasEncodedFilename   
)

◆ TEST_F() [22/69]

TEST_F ( TestURIUtils  ,
HasEncodedHostname   
)

◆ TEST_F() [23/69]

TEST_F ( TestURIUtils  ,
HasExtension   
)

◆ TEST_F() [24/69]

TEST_F ( TestURIUtils  ,
HasParentInHostname   
)

◆ TEST_F() [25/69]

TEST_F ( TestURIUtils  ,
HasSlashAtEnd   
)

◆ TEST_F() [26/69]

TEST_F ( TestURIUtils  ,
IsAddonsPath   
)

◆ TEST_F() [27/69]

TEST_F ( TestURIUtils  ,
IsBlurayPath   
)

◆ TEST_F() [28/69]

TEST_F ( TestURIUtils  ,
IsCDDA   
)

◆ TEST_F() [29/69]

TEST_F ( TestURIUtils  ,
IsDOSPath   
)

◆ TEST_F() [30/69]

TEST_F ( TestURIUtils  ,
IsDVD   
)

◆ TEST_F() [31/69]

TEST_F ( TestURIUtils  ,
IsFTP   
)

◆ TEST_F() [32/69]

TEST_F ( TestURIUtils  ,
IsHD   
)

◆ TEST_F() [33/69]

TEST_F ( TestURIUtils  ,
IsInArchive   
)

◆ TEST_F() [34/69]

TEST_F ( TestURIUtils  ,
IsInRAR   
)

◆ TEST_F() [35/69]

TEST_F ( TestURIUtils  ,
IsInternetStream   
)

◆ TEST_F() [36/69]

TEST_F ( TestURIUtils  ,
IsInZIP   
)

◆ TEST_F() [37/69]

TEST_F ( TestURIUtils  ,
IsISO9660   
)

◆ TEST_F() [38/69]

TEST_F ( TestURIUtils  ,
IsLiveTV   
)

◆ TEST_F() [39/69]

TEST_F ( TestURIUtils  ,
IsMultiPath   
)

◆ TEST_F() [40/69]

TEST_F ( TestURIUtils  ,
IsMusicDb   
)

◆ TEST_F() [41/69]

TEST_F ( TestURIUtils  ,
IsNfs   
)

◆ TEST_F() [42/69]

TEST_F ( TestURIUtils  ,
IsOnDVD   
)

◆ TEST_F() [43/69]

TEST_F ( TestURIUtils  ,
IsOnLAN   
)

◆ TEST_F() [44/69]

TEST_F ( TestURIUtils  ,
IsPlugin   
)

◆ TEST_F() [45/69]

TEST_F ( TestURIUtils  ,
IsPVRRadioChannel   
)

◆ TEST_F() [46/69]

TEST_F ( TestURIUtils  ,
IsRAR   
)

◆ TEST_F() [47/69]

TEST_F ( TestURIUtils  ,
IsRemote   
)

◆ TEST_F() [48/69]

TEST_F ( TestURIUtils  ,
IsScript   
)

◆ TEST_F() [49/69]

TEST_F ( TestURIUtils  ,
IsSmb   
)

◆ TEST_F() [50/69]

TEST_F ( TestURIUtils  ,
IsSourcesPath   
)

◆ TEST_F() [51/69]

TEST_F ( TestURIUtils  ,
IsSpecial   
)

◆ TEST_F() [52/69]

TEST_F ( TestURIUtils  ,
IsStack   
)

◆ TEST_F() [53/69]

TEST_F ( TestURIUtils  ,
IsUPnP   
)

◆ TEST_F() [54/69]

TEST_F ( TestURIUtils  ,
IsURL   
)

◆ TEST_F() [55/69]

TEST_F ( TestURIUtils  ,
IsVideoDb   
)

◆ TEST_F() [56/69]

TEST_F ( TestURIUtils  ,
IsZIP   
)

◆ TEST_F() [57/69]

TEST_F ( TestURIUtils  ,
PathHasParent   
)

◆ TEST_F() [58/69]

TEST_F ( TestURIUtils  ,
RemoveExtension   
)

◆ TEST_F() [59/69]

TEST_F ( TestURIUtils  ,
RemovePartNumberFromTitle   
)

◆ TEST_F() [60/69]

TEST_F ( TestURIUtils  ,
RemoveSlashAtEnd   
)

◆ TEST_F() [61/69]

TEST_F ( TestURIUtils  ,
ReplaceExtension   
)

◆ TEST_F() [62/69]

TEST_F ( TestURIUtils  ,
Split   
)

◆ TEST_F() [63/69]

TEST_F ( TestURIUtils  ,
SplitPath   
)

◆ TEST_F() [64/69]

TEST_F ( TestURIUtils  ,
SplitPathLocal   
)

◆ TEST_F() [65/69]

TEST_F ( TestURIUtils  ,
SubstitutePath   
)

◆ TEST_F() [66/69]

TEST_F ( TestURIUtils  ,
UpdateUrlEncoding   
)

◆ TEST_F() [67/69]

TEST_F ( TestURIUtils  ,
URLDecode   
)

◆ TEST_F() [68/69]

TEST_F ( TestURIUtils  ,
URLEncode   
)

◆ TEST_F() [69/69]

TEST_F ( TestURIUtils  ,
URLEncodeDecode   
)

◆ TEST_P()

TEST_P ( TestLANParamTest  ,
TestIsHostOnLAN   
)

Variable Documentation

◆ EncodingTestData

constexpr URLEncodings EncodingTestData[]
constexpr

◆ InvalidEncodingTestData

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

◆ RFC1738EncodingTestData

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

◆ RFC3986EncodingTestData

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

◆ 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:947