Skip to content
Snippets Groups Projects
Commit 299981a4 authored by Carl Philipp Klemm's avatar Carl Philipp Klemm
Browse files

test: add test for resample

parent 8115016f
Branches
No related tags found
No related merge requests found
......@@ -523,6 +523,28 @@ bool testRemoveSeriesResistance()
return true;
}
bool testResize()
{
try
{
eis::Spectra spectra = eis::Spectra::loadFromDisk("../rescaleTest.csv");
std::vector<eis::DataPoint> data = eis::rescale(spectra.data, 50);
eis::removeDuplicates(data);
if(data.size() != 50)
{
eis::Log(eis::Log::ERROR)<<__func__<<"Resized data is of incorrect size";
return false;
}
}
catch(eis::file_error& err)
{
eis::Log(eis::Log::ERROR)<<__func__<<" could not load ../rescaleTest.csv skipping test";
return true;
}
return true;
}
int main(int argc, char** argv)
{
eis::Log::headers = true;
......@@ -591,5 +613,8 @@ int main(int argc, char** argv)
if(!testRemoveSeriesResistance())
return 21;
if(!testResize())
return 22;
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment