Skip to content
Snippets Groups Projects
Commit 3ccaa1c0 authored by Van Herck, Walter's avatar Van Herck, Walter
Browse files

Outputdata: unit test for setAllTo() after clear() + fix

parent bb59d873
No related branches found
No related tags found
No related merge requests found
......@@ -39,7 +39,7 @@ class OutputData
{
public:
OutputData();
~OutputData() { clear(); }
~OutputData();
OutputData* clone() const;
void copyFrom(const OutputData<T>& x);
......@@ -239,6 +239,11 @@ OutputData<T>::OutputData()
allocate();
}
template <class T> OutputData<T>::~OutputData() {
clear();
delete mp_ll_data;
}
template <class T>
OutputData<T>* OutputData<T>::clone() const
{
......@@ -565,10 +570,9 @@ template <class T>
void OutputData<T>::clear()
{
m_value_axes.clear();
delete mp_ll_data;
mp_ll_data = 0;
delete mp_mask;
mp_mask = 0;
allocate();
}
template <class T>
......
......@@ -173,6 +173,13 @@ TEST_F(OutputDataTest, SetEllipticMask)
}
}
TEST_F(OutputDataTest, SetCleared)
{
db_data_3d.clear();
db_data_3d.setAllTo(1.0);
EXPECT_EQ( db_data_3d[0], 1.0);
}
#endif // OUTPUTDATATEST_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment