Class dsp::test::SumSourceTest

class SumSourceTest : public testing::TestWithParam<dsp::TimeSeries::Order>

Unit test class for testing the SumSource functionality. This class is derived from ::testing::TestWithParam, allowing parameterized tests with different configurations of the SumSource. The parameters are passed as a tuple containing:

Public Functions

SumSourceTest()

Construct a new SumSourceTest object.

~SumSourceTest() = default

Destroy the SumSourceTest object.

dsp::test::SumSource *source_under_test(int niterations = 1)

Construct and configure the dsp::test::SumSource object to be tested.

bool prepare_source(std::shared_ptr<dsp::test::SumSource> source)

helper function for performing SumSource transform.

void assert_data(std::shared_ptr<SumSource> source, bool all_zeros = false)

Use to assert the output data is the sum of the outputs of the individual sources.

void assert_fpt(std::shared_ptr<SumSource> source, bool all_zeros = false)

Use to assert the FPT ordered output data is the sum of the outputs of the individual sources.

void assert_tfp(std::shared_ptr<SumSource> source, bool all_zeros = false)

Use to assert the TFP ordered output data is the sum of the outputs of the individual sources.

Public Members

Reference::To<dsp::TimeSeries> output = {nullptr}

output container

Reference::To<dsp::test::GaussianNoiseSource> gaussian_noise = {nullptr}

gaussian noise source

Reference::To<dsp::test::ImpulsiveNoiseSource> impulsive_noise = {nullptr}

impulsive noise source

dsp::TimeSeries::Order order = dsp::TimeSeries::OrderFPT

the ordering for the input timeseries

unsigned nchan = {32}

number of channels

unsigned npol = {2}

number of polarisations

unsigned ndim = {2}

number of dimensions

uint64_t ndat = {64}

number of time samples

double tsamp_sec = {0.03125}

Sampling rate, in seconds This is 1/32

double period = {1.0}

Period of impulses This means 2 impulses occur over the 64 samples

double impulse_duration = {0.0625}

The duration of impulses given the tsamp & period, this is 2 samples in a row

float height = {10.0}

Height of impulses.

float phase_offset = {0.5}

Phase offset of impulses.