Kodi Documentation 23.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
TestVideoDatabaseContentGeometry.cpp File Reference
#include "DatabaseManager.h"
#include "FileItem.h"
#include "ServiceBroker.h"
#include "filesystem/File.h"
#include "settings/SettingsComponent.h"
#include "test/TestUtils.h"
#include "utils/Artwork.h"
#include "utils/StringUtils.h"
#include "utils/URIUtils.h"
#include "video/VideoDatabaseDDL.h"
#include "video/VideoInfoTag.h"
#include "video/VideoManagerTypes.h"
#include "video/geometry/ContentGeometryRecord.h"
#include "video/test/VideoDatabaseTestBase.h"
#include <algorithm>
#include <cstdlib>
#include <ranges>
#include <string>
#include <vector>
#include <gtest/gtest.h>

Classes

class  TestVideoDatabaseContentGeometry
 

Functions

 TEST_F (TestVideoDatabaseContentGeometry, StoresAndReadsBack)
 
 TEST_F (TestVideoDatabaseContentGeometry, StoresAFileSizeBeyondThirtyTwoBits)
 A file size past MySQL's signed 32-bit INTEGER.
 
 TEST_F (TestVideoDatabaseContentGeometry, AChangedFileReadsAsMissing)
 Same file, different content.
 
 TEST_F (TestVideoDatabaseContentGeometry, AnUnknownIdentityReadsAsMissing)
 A caller that could not stat the file gets no rectangle.
 
 TEST_F (TestVideoDatabaseContentGeometry, AFileWithNoRowReadsAsMissing)
 
 TEST_F (TestVideoDatabaseContentGeometry, AnOlderAlgorithmVersionIsStaleNotMissing)
 A superseded detector keeps serving.
 
 TEST_F (TestVideoDatabaseContentGeometry, AStaleRowFromAChangedFileIsStillMissing)
 Identity is checked before version.
 
 TEST_F (TestVideoDatabaseContentGeometry, StoringAgainReplacesRatherThanAccumulates)
 
 TEST_F (TestVideoDatabaseContentGeometry, AnAttemptThatFoundNothingIsStored)
 
 TEST_F (TestVideoDatabaseContentGeometry, AFailureReadsAsMissingToEveryConsumer)
 
 TEST_F (TestVideoDatabaseContentGeometry, ARecordWithNoIdentityTakesTheFilesOwn)
 An NFO is trusted for the file as it stands when it is imported.
 
 TEST_F (TestVideoDatabaseContentGeometry, AStoredRecordIsCheckedAgainstTheFileAtItsPath)
 
 TEST_F (TestVideoDatabaseContentGeometry, AFileWithNoRowHasNothingStored)
 
 TEST_F (TestVideoDatabaseContentGeometry, TheCandidateListCarriesEveryFileAndWhatItHolds)
 
 TEST_F (TestVideoDatabaseContentGeometry, StoringInsideACallersTransactionJoinsIt)
 
 TEST_F (TestVideoDatabaseContentGeometry, DeletingTheFileCascadesToTheGeometry)
 The delete_file trigger reaches the new tables.
 
 TEST_F (TestVideoDatabaseContentGeometry, TheTriggerAloneRemovesTheGeometry)
 The trigger on its own, rather than whatever else DeleteFile() does on the way.
 
 TEST_F (TestVideoDatabaseContentGeometry, TheCascadeSurvivesTheAnalyticsCycleAnUpgradePerforms)
 The cascade returns by itself after the drop-and-recreate cycle an upgrade performs.
 
 TEST (TestVideoDatabaseContentGeometryMigration, UpgradingFrom154AddsTheTableAndItsCascade)
 The real 154 to 155 upgrade, driven through CDatabaseManager to the current schema.
 
 TEST_F (TestVideoDatabaseContentGeometry, TheStoredReadIgnoresIdentityEntirely)
 The stored read is for moving the row about, and never consults the file.
 
 TEST_F (TestVideoDatabaseContentGeometry, AVersionStoresTheMeasurementItWasAddedWith)
 
 TEST (TestVideoDatabaseContentGeometryMySQL, StoresAndCascadesOnMySQL)
 

Function Documentation

◆ TEST() [1/2]

TEST ( TestVideoDatabaseContentGeometryMigration ,
UpgradingFrom154AddsTheTableAndItsCascade  )

The real 154 to 155 upgrade, driven through CDatabaseManager to the current schema.

◆ TEST() [2/2]

TEST ( TestVideoDatabaseContentGeometryMySQL ,
StoresAndCascadesOnMySQL  )

The same storage and cascade against a real MySQL server, which the SQLite tests cannot cover. Skipped unless pointed at one:

KODI_TEST_MYSQL_HOST=127.0.0.1 KODI_TEST_MYSQL_USER=kodi KODI_TEST_MYSQL_PASS=kodi

The named database is created if the user may create it, and is left behind afterwards.

◆ TEST_F() [1/20]

TEST_F ( TestVideoDatabaseContentGeometry ,
AChangedFileReadsAsMissing  )

Same file, different content.

◆ TEST_F() [2/20]

TEST_F ( TestVideoDatabaseContentGeometry ,
AFailureReadsAsMissingToEveryConsumer  )

Nothing that resolves a rectangle should have to know the difference between never having tried and having tried and got nothing, so a failure reads back as no measurement at all.

◆ TEST_F() [3/20]

TEST_F ( TestVideoDatabaseContentGeometry ,
AFileWithNoRowHasNothingStored  )

◆ TEST_F() [4/20]

TEST_F ( TestVideoDatabaseContentGeometry ,
AFileWithNoRowReadsAsMissing  )

◆ TEST_F() [5/20]

TEST_F ( TestVideoDatabaseContentGeometry ,
AnAttemptThatFoundNothingIsStored  )

A record saying measuring found nothing is stored precisely because it has no ratio. Without it the sweep could not remember that it had already tried.

◆ TEST_F() [6/20]

TEST_F ( TestVideoDatabaseContentGeometry ,
AnOlderAlgorithmVersionIsStaleNotMissing  )

A superseded detector keeps serving.

◆ TEST_F() [7/20]

TEST_F ( TestVideoDatabaseContentGeometry ,
AnUnknownIdentityReadsAsMissing  )

A caller that could not stat the file gets no rectangle.

◆ TEST_F() [8/20]

TEST_F ( TestVideoDatabaseContentGeometry ,
ARecordWithNoIdentityTakesTheFilesOwn  )

An NFO is trusted for the file as it stands when it is imported.

◆ TEST_F() [9/20]

TEST_F ( TestVideoDatabaseContentGeometry ,
AStaleRowFromAChangedFileIsStillMissing  )

Identity is checked before version.

◆ TEST_F() [10/20]

TEST_F ( TestVideoDatabaseContentGeometry ,
AStoredRecordIsCheckedAgainstTheFileAtItsPath  )

◆ TEST_F() [11/20]

TEST_F ( TestVideoDatabaseContentGeometry ,
AVersionStoresTheMeasurementItWasAddedWith  )

◆ TEST_F() [12/20]

TEST_F ( TestVideoDatabaseContentGeometry ,
DeletingTheFileCascadesToTheGeometry  )

The delete_file trigger reaches the new tables.

◆ TEST_F() [13/20]

TEST_F ( TestVideoDatabaseContentGeometry ,
StoresAFileSizeBeyondThirtyTwoBits  )

A file size past MySQL's signed 32-bit INTEGER.

◆ TEST_F() [14/20]

TEST_F ( TestVideoDatabaseContentGeometry ,
StoresAndReadsBack  )

◆ TEST_F() [15/20]

TEST_F ( TestVideoDatabaseContentGeometry ,
StoringAgainReplacesRatherThanAccumulates  )

◆ TEST_F() [16/20]

TEST_F ( TestVideoDatabaseContentGeometry ,
StoringInsideACallersTransactionJoinsIt  )

A library update stores the geometry from inside its own transaction, and the write must belong to it. Shown by rolling the caller's back afterwards: the geometry goes with it.

◆ TEST_F() [17/20]

TEST_F ( TestVideoDatabaseContentGeometry ,
TheCandidateListCarriesEveryFileAndWhatItHolds  )

The sweep's work list. Every file comes back whether or not it has been measured, because the criterion that retires a row - the file having changed underneath it - can only be answered by stat'ing the file, which is not something SQL can do.

◆ TEST_F() [18/20]

TEST_F ( TestVideoDatabaseContentGeometry ,
TheCascadeSurvivesTheAnalyticsCycleAnUpgradePerforms  )

The cascade returns by itself after the drop-and-recreate cycle an upgrade performs.

◆ TEST_F() [19/20]

TEST_F ( TestVideoDatabaseContentGeometry ,
TheStoredReadIgnoresIdentityEntirely  )

The stored read is for moving the row about, and never consults the file.

◆ TEST_F() [20/20]

TEST_F ( TestVideoDatabaseContentGeometry ,
TheTriggerAloneRemovesTheGeometry  )

The trigger on its own, rather than whatever else DeleteFile() does on the way.