Class dsp::test::TScrunchTest

class TScrunchTest : public testing::TestWithParam<TScrunchTestParam>, public dsp::test::TransformationTestHelper<TimeSeries, TimeSeries>

A value-parameterized test suite for TScrunchTest class.

Public Functions

dsp::TScrunch *new_device_under_test()

Construct and configure the dsp::TScrunch object to be tested.

void generate_data()

Generate test data for input to TScrunch::transform.

void assert_data()

Compare data output by TScrunch::transform against expectations.

float get_expected_value(unsigned ichan, unsigned nchan, unsigned ipol, uint64_t odat, unsigned sfactor)

Get the expected input or output value for the timeseries.

input data are computed as: ((ichan/nchan) * sample_index) + ipol output data are computed as the sum of corresponding input data for the scrunch factor

Parameters:
  • ichan – channel number

  • nchan – total number of channels

  • ipol – polarisation number

  • odat – output time sample

  • sfactor – time scrunch factor

Returns:

float value that corresponds to the input

void assert_transform_configurations(dsp::TScrunch*)

Helper function for asserting transform configurations.

void assert_fpt()

Helper function for asserting FPT-ordered data.

void generate_fpt()

Helper function for populating the input container with FPT-ordered data.

void assert_tfp()

Helper function for asserting TFP-ordered data.

void generate_tfp()

Helper function for populating the input container with TFP-ordered data.

Public Members

const std::pair<unsigned, unsigned> nblocks_range = {2, 4}

range of valid number of blocks to test

const std::pair<unsigned, unsigned> nchan_range = {1, 31}

range of valid nchan to test

const std::pair<unsigned, unsigned> ndat_range = {2, 1023}

range of valid ndat to test

const std::pair<unsigned, unsigned> small_nchan_range = {1, 4}

range of valid nchan to test for small nchanpoldim tests

const std::pair<unsigned, unsigned> large_nchan_range = {32, 128}

range of valid nchan to test for large nchanpoldim tests

const std::pair<unsigned, unsigned> very_large_nchan_range = {32768, 65536}

range of valid nchan to test for very large nchanpoldim tests

uint64_t ndat = {0}

number of input time samples

unsigned tscrunch_factor = {0}

number of time samples to scrunch in time

std::vector<Signal::State> states

list of signal states that can be tested