RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Functions | Variables
main.cpp File Reference

Test program for PersistentRepoAdapter integration tests. More...

#include <algorithm>
#include <config-ng/ciiConfigApi.hpp>
#include <filesystem>
#include <fmt/format.h>
#include <fstream>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <tuple>
#include "rtctk/componentFramework/test/repositoryIfTestSuiteLegacy.hpp"
#include <rtctk/componentFramework/fitsIoFunctions.hpp>
#include <rtctk/componentFramework/persistentRepoAdapter.hpp>
#include <rtctk/componentFramework/typeTraits.hpp>

Classes

class  TestPersistentRepoAdapter
 
class  TestPersistentRepoAdapterWithFits< T >
 Test fixture for specific tests related to FITS file reading and writing. More...
 

Namespaces

namespace  rtctk
 
namespace  rtctk::componentFramework
 
namespace  rtctk::componentFramework::test
 

Typedefs

using PathList = RepositoryIf::PathList
 
typedef testing::Types< PersistentRepoAdapterRepositoryTypes
 
using DataPointTypes
 

Functions

 rtctk::componentFramework::test::INSTANTIATE_TYPED_TEST_SUITE_P (TestPersistentRepoAdapter, RepositoryIfTestSuiteLegacy, RepositoryTypes, testing::internal::DefaultNameGenerator)
 
 TEST_F (TestPersistentRepoAdapter, DataPointCreationAndDeletion)
 
 TEST_F (TestPersistentRepoAdapter, TypesAreReturnedCorrectly)
 
 TEST_F (TestPersistentRepoAdapter, SizesAreReturnedCorrectly)
 
 TEST_F (TestPersistentRepoAdapter, DataPointWriteAndRead)
 
template<typename T >
auto CreateReferenceData ()
 Helper function to prepare input test data for a specific datapoint type.
 
template<typename T >
auto CreateEmptyResultBuffer ()
 Helper function to prepare an empty output buffer for a specific datapoint type.
 
template<typename T , typename D >
auto PrepareSpan (D &data)
 Helper function to prepare a span object associated with a data buffer.
 
template<typename T >
void TestWriteAndReadWithSpansForType (RepositoryIf *adapter)
 Helper function to test read and write operations using spans.
 
 TEST_F (TestPersistentRepoAdapter, DataPointWriteAndReadWithSpans)
 
 TEST_F (TestPersistentRepoAdapter, GetChildren)
 
 TEST_F (TestPersistentRepoAdapter, GetChildrenEdgeCase1)
 
 TEST_F (TestPersistentRepoAdapter, GetChildrenEdgeCase2)
 
 TEST_F (TestPersistentRepoAdapter, GetChildrenEdgeCase3)
 
 TEST_F (TestPersistentRepoAdapter, ReadFitsFilesFromExternalUris)
 
 TYPED_TEST_SUITE (TestPersistentRepoAdapterWithFits, DataPointTypes)
 
 TYPED_TEST (TestPersistentRepoAdapterWithFits, WriteAndReadSmallData)
 
 TYPED_TEST (TestPersistentRepoAdapterWithFits, WriteAndReadLargeData)
 
 TYPED_TEST (TestPersistentRepoAdapterWithFits, SwitchFromSmallToLarge)
 
 TYPED_TEST (TestPersistentRepoAdapterWithFits, SwitchFromLargeToSmall)
 
int main (int argc, char **argv)
 

Variables

std::string g_repodir = std::string("persistentRepoTest-pid-") + std::to_string(getpid())
 

Detailed Description

Test program for PersistentRepoAdapter integration tests.

Typedef Documentation

◆ DataPointTypes

Initial value:
testing::Types<std::vector<bool>,
std::vector<int8_t>,
std::vector<int16_t>,
std::vector<int32_t>,
std::vector<int64_t>,
std::vector<uint8_t>,
std::vector<uint16_t>,
std::vector<uint32_t>,
std::vector<uint64_t>,
std::vector<float>,
std::vector<double>,
A buffer class representing 2D matrix data.
Definition matrixBuffer.hpp:28

◆ PathList

◆ RepositoryTypes

typedef testing::Types<PersistentRepoAdapter> RepositoryTypes

Function Documentation

◆ CreateEmptyResultBuffer()

template<typename T >
auto CreateEmptyResultBuffer ( )

Helper function to prepare an empty output buffer for a specific datapoint type.

Template Parameters
TThe datapoint type for which to prepare output buffer.
Returns
A new buffer object of the correct size but filled with zeros.

◆ CreateReferenceData()

template<typename T >
auto CreateReferenceData ( )

Helper function to prepare input test data for a specific datapoint type.

Template Parameters
TThe datapoint type for which to prepare reference test data.
Returns
A new buffer object filled with a test pattern.

◆ main()

int main ( int argc,
char ** argv )

◆ PrepareSpan()

template<typename T , typename D >
auto PrepareSpan ( D & data)

Helper function to prepare a span object associated with a data buffer.

This function works with buffers created by CreateReferenceData or CreateEmptyResultBuffer.

Template Parameters
TThe data type of the datapoint that is being created.
DThe data type of the buffer.
Parameters
dataThe data buffer that the span will alias.
Returns
A new span object.

◆ TEST_F() [1/10]

TEST_F ( TestPersistentRepoAdapter ,
DataPointCreationAndDeletion  )

◆ TEST_F() [2/10]

TEST_F ( TestPersistentRepoAdapter ,
DataPointWriteAndRead  )

◆ TEST_F() [3/10]

TEST_F ( TestPersistentRepoAdapter ,
DataPointWriteAndReadWithSpans  )

◆ TEST_F() [4/10]

TEST_F ( TestPersistentRepoAdapter ,
GetChildren  )

◆ TEST_F() [5/10]

TEST_F ( TestPersistentRepoAdapter ,
GetChildrenEdgeCase1  )

◆ TEST_F() [6/10]

TEST_F ( TestPersistentRepoAdapter ,
GetChildrenEdgeCase2  )

◆ TEST_F() [7/10]

TEST_F ( TestPersistentRepoAdapter ,
GetChildrenEdgeCase3  )

◆ TEST_F() [8/10]

TEST_F ( TestPersistentRepoAdapter ,
ReadFitsFilesFromExternalUris  )

◆ TEST_F() [9/10]

TEST_F ( TestPersistentRepoAdapter ,
SizesAreReturnedCorrectly  )

◆ TEST_F() [10/10]

TEST_F ( TestPersistentRepoAdapter ,
TypesAreReturnedCorrectly  )

◆ TestWriteAndReadWithSpansForType()

template<typename T >
void TestWriteAndReadWithSpansForType ( RepositoryIf * adapter)

Helper function to test read and write operations using spans.

Template Parameters
TThe datapoint type to use for the testing.
Parameters
adapterThe repository adapter who's API is under test.

◆ TYPED_TEST() [1/4]

TYPED_TEST ( TestPersistentRepoAdapterWithFits ,
SwitchFromLargeToSmall  )

◆ TYPED_TEST() [2/4]

TYPED_TEST ( TestPersistentRepoAdapterWithFits ,
SwitchFromSmallToLarge  )

◆ TYPED_TEST() [3/4]

TYPED_TEST ( TestPersistentRepoAdapterWithFits ,
WriteAndReadLargeData  )

◆ TYPED_TEST() [4/4]

TYPED_TEST ( TestPersistentRepoAdapterWithFits ,
WriteAndReadSmallData  )

◆ TYPED_TEST_SUITE()

Variable Documentation

◆ g_repodir

std::string g_repodir = std::string("persistentRepoTest-pid-") + std::to_string(getpid())