Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
TestUPnPInternal.cpp File Reference
#include "FileItem.h"
#include "XBDateTime.h"
#include "network/upnp/UPnPInternal.h"
#include <memory>
#include <string>
#include <Platinum/Source/Devices/MediaServer/PltDidl.h>
#include <Platinum/Source/Devices/MediaServer/PltMediaItem.h>
#include <gtest/gtest.h>

Functions

 TEST (TestUPnPInternal, BuildObjectSetsDateFromDateOnlyValue)
 
 TEST (TestUPnPInternal, BuildObjectSetsDateFromDateTimeValue)
 
 TEST (TestUPnPInternal, BuildObjectLeavesDateUnsetWhenNoDatePresent)
 
 TEST (TestUPnPInternal, BuildObjectLeavesDateUnsetOnUnparsableValue)
 
 TEST (TestUPnPInternal, DidlParsingFillsMediaObjectDateAndNotDescriptionDate)
 PLT_Description::date is never filled by Platinum, so it must not be the source of truth.
 
 TEST (TestUPnPInternal, BuildObjectSetsDateForDidlSourcedItem)
 
 TEST (TestUPnPInternal, BuildObjectDatesFromDidlAreOrdered)
 The point of the fix: dates from a server are comparable, so SortBy::DATE works.
 
 TEST (TestUPnPInternal, AddAlternateMimeResourcesOffersRegisteredFlacSpelling)
 A renderer naming only the registered type can select a FLAC Kodi offers.
 
 TEST (TestUPnPInternal, AddAlternateMimeResourcesOffersLegacyFlacSpelling)
 The mapping runs both ways, so a server offering only the registered type also matches.
 
 TEST (TestUPnPInternal, AddAlternateMimeResourcesKeepsUriAndProtocol)
 The added resource is the same stream, so only the content type differs.
 
 TEST (TestUPnPInternal, AddAlternateMimeResourcesDoesNotDuplicate)
 An object already carrying both spellings is left alone rather than duplicated.
 
 TEST (TestUPnPInternal, AddAlternateMimeResourcesLeavesUnrelatedTypes)
 A content type with no alternate spelling is untouched.
 
 TEST (TestUPnPInternal, PreferResourceAddressesPutsAReachableAddressFirst)
 
 TEST (TestUPnPInternal, PreferResourceAddressesKeepsTheRestInOrder)
 ␈rief The rest keep their order behind it, so nothing is lost or reshuffled.
 
 TEST (TestUPnPInternal, PreferResourceAddressesLeavesTheOrderAloneWhenNoneMatch)
 ␈rief With nothing known to be reachable the order is left alone rather than guessed at.
 
 TEST (TestUPnPInternal, AddAlternateMimeResourcesOffersEveryAddress)
 

Function Documentation

◆ TEST() [1/16]

TEST ( TestUPnPInternal ,
AddAlternateMimeResourcesDoesNotDuplicate  )

An object already carrying both spellings is left alone rather than duplicated.

◆ TEST() [2/16]

TEST ( TestUPnPInternal ,
AddAlternateMimeResourcesKeepsUriAndProtocol  )

The added resource is the same stream, so only the content type differs.

◆ TEST() [3/16]

TEST ( TestUPnPInternal ,
AddAlternateMimeResourcesLeavesUnrelatedTypes  )

A content type with no alternate spelling is untouched.

◆ TEST() [4/16]

TEST ( TestUPnPInternal ,
AddAlternateMimeResourcesOffersEveryAddress  )

The alternate carries the uri of the resource it was cloned from, so each address needs its own or the only spelling the renderer understands may name an address it cannot reach.

◆ TEST() [5/16]

TEST ( TestUPnPInternal ,
AddAlternateMimeResourcesOffersLegacyFlacSpelling  )

The mapping runs both ways, so a server offering only the registered type also matches.

◆ TEST() [6/16]

TEST ( TestUPnPInternal ,
AddAlternateMimeResourcesOffersRegisteredFlacSpelling  )

A renderer naming only the registered type can select a FLAC Kodi offers.

◆ TEST() [7/16]

TEST ( TestUPnPInternal ,
BuildObjectDatesFromDidlAreOrdered  )

The point of the fix: dates from a server are comparable, so SortBy::DATE works.

◆ TEST() [8/16]

TEST ( TestUPnPInternal ,
BuildObjectLeavesDateUnsetOnUnparsableValue  )

◆ TEST() [9/16]

TEST ( TestUPnPInternal ,
BuildObjectLeavesDateUnsetWhenNoDatePresent  )

◆ TEST() [10/16]

TEST ( TestUPnPInternal ,
BuildObjectSetsDateForDidlSourcedItem  )

◆ TEST() [11/16]

TEST ( TestUPnPInternal ,
BuildObjectSetsDateFromDateOnlyValue  )

◆ TEST() [12/16]

TEST ( TestUPnPInternal ,
BuildObjectSetsDateFromDateTimeValue  )

◆ TEST() [13/16]

TEST ( TestUPnPInternal ,
DidlParsingFillsMediaObjectDateAndNotDescriptionDate  )

PLT_Description::date is never filled by Platinum, so it must not be the source of truth.

◆ TEST() [14/16]

TEST ( TestUPnPInternal ,
PreferResourceAddressesKeepsTheRestInOrder  )

␈rief The rest keep their order behind it, so nothing is lost or reshuffled.

◆ TEST() [15/16]

TEST ( TestUPnPInternal ,
PreferResourceAddressesLeavesTheOrderAloneWhenNoneMatch  )

␈rief With nothing known to be reachable the order is left alone rather than guessed at.

◆ TEST() [16/16]

TEST ( TestUPnPInternal ,
PreferResourceAddressesPutsAReachableAddressFirst  )

One resource is built per local address, in host enumeration order, so the first is routinely a virtual adapter the renderer cannot reach.