HLCC Documentation 2.2.0
Loading...
Searching...
No Matches
Protected Member Functions | Protected Attributes | List of all members
IcdCodeTest Class Reference
Inheritance diagram for IcdCodeTest:

Protected Member Functions

void SetUp () override
 
void TearDown () override
 
void ValidatePresetData (const std::shared_ptr< const ::ccsinsif::PresetData > &preset_data)
 
std::shared_ptr< const ccsinsif::PresetArgs > GetPresetArgs () const
 
void SetPresetArgs (std::shared_ptr< const ccsinsif::PresetArgs > preset_args)
 
std::shared_ptr< const ccsinsif::PresetData > GetPresetData () const
 
void SetPresetData (std::shared_ptr< const ccsinsif::PresetData > preset_data)
 

Protected Attributes

log4cplus::Logger logger {}
 
std::shared_ptr< elt::mal::Mal > m_mal_entity_factory {}
 
std::shared_ptr< const ccsinsif::PresetArgs > m_preset_args
 
std::shared_ptr< const ccsinsif::PresetData > m_preset_data
 
std::mutex m_mutex {}
 
const double ra_expected = 1.234
 
const std::string system_expected = "ICRS"
 

Detailed Description

This test was created as a demonstration of a memory corruption problem, see https://jira.eso.org/browse/ECII-635. Then CII clarified that the problem was caused by a known limitation of ZMQ entities, where the parent entity is the owner of the proto message object when we clone the parent. In that case, a child object can be corrupted once we release the parent pointer, even though we keep a valid shared pointer to the child. The answer was to either clone the parent struct and keep that pointer, or to clone the child struct and keep that pointer. We keep the test anyway, to accidentally spot other problems, or to be extended for specific issues with ICD-generated code in the future.

Member Function Documentation

◆ GetPresetArgs()

std::shared_ptr< const ccsinsif::PresetArgs > IcdCodeTest::GetPresetArgs ( ) const
inlineprotected

Getter for shared PresetData instance (copy of shared_ptr).

◆ GetPresetData()

std::shared_ptr< const ccsinsif::PresetData > IcdCodeTest::GetPresetData ( ) const
inlineprotected

Getter for shared PresetData instance (copy of shared_ptr).

◆ SetPresetArgs()

void IcdCodeTest::SetPresetArgs ( std::shared_ptr< const ccsinsif::PresetArgs > preset_args)
inlineprotected

Setter for shared PresetData instance (copy of shared_ptr).

◆ SetPresetData()

void IcdCodeTest::SetPresetData ( std::shared_ptr< const ccsinsif::PresetData > preset_data)
inlineprotected

Setter for shared PresetData instance (copy of shared_ptr).

◆ SetUp()

void IcdCodeTest::SetUp ( )
inlineoverrideprotected

◆ TearDown()

void IcdCodeTest::TearDown ( )
inlineoverrideprotected

◆ ValidatePresetData()

void IcdCodeTest::ValidatePresetData ( const std::shared_ptr< const ::ccsinsif::PresetData > & preset_data)
protected

Validates 2 known fields of the PresetData instance.

Member Data Documentation

◆ logger

log4cplus::Logger IcdCodeTest::logger {}
protected

◆ m_mal_entity_factory

std::shared_ptr<elt::mal::Mal> IcdCodeTest::m_mal_entity_factory {}
protected

MAL instance used to instantiate ICD-defined structs like PresetData.

◆ m_mutex

std::mutex IcdCodeTest::m_mutex {}
mutableprotected

Mutex for GetPresetData / SetPresetData.

◆ m_preset_args

std::shared_ptr<const ccsinsif::PresetArgs> IcdCodeTest::m_preset_args
protected

PresetData instance shared between threads.

◆ m_preset_data

std::shared_ptr<const ccsinsif::PresetData> IcdCodeTest::m_preset_data
protected

PresetData instance shared between threads.

◆ ra_expected

const double IcdCodeTest::ra_expected = 1.234
protected

To avoid dependency on ptk, we do not use angles such as Radians{1.0_deg}.

◆ system_expected

const std::string IcdCodeTest::system_expected = "ICRS"
protected

The documentation for this class was generated from the following file: