swh:1:snp:e6d42e6731ce66e3c09de07ac49964c03139e990
Tip revision: 1b619a75151e3d5d95d32a2fb732e1208ec0cd33 authored by Konrad Werys on 01 November 2019, 11:50:53 UTC
ci: big changes to the builds v11
ci: big changes to the builds v11
Tip revision: 1b619a7
OxTestData_test.cpp
/*!
* \file OxTestData_test.cpp
* \author Konrad Werys
* \date 2018/08/19
*/
#include "gtest/gtest.h"
#include "OxTestData.h"
#include "TomatoParser.h"
TEST(OxTestData, read_file) {
typedef double TYPE;
char filePath [] = "testData/blood.yaml";
Ox::TestData<TYPE> testData(filePath);
TYPE signalMag[7] = { 55, 49, 29, 22, 51, 61, 64};
TYPE signalPha[7] = { 3348, 3341, 3310, -843, -767, -777, -768};
TYPE signs[7] = { -1, -1, -1, 1, 1, 1, 1};
TYPE invTimes[7] = { 100, 180, 260, 1715, 3337, 4907, 6455};
TYPE resultsMolli[3] = { 65.8968, 124.079, 1571.81};
TYPE resultsShmolli[3] = { 66.73, 129.59, 1601.5 };
std::vector<TYPE> signalMagVec(signalMag, signalMag+7);
std::vector<TYPE> signalPhaVec(signalPha, signalPha+7);
std::vector<TYPE> signsVec(signs, signs+7);
std::vector<TYPE> invTimesVec(invTimes, invTimes+7);
std::vector<TYPE> resultsMolliVec(resultsMolli, resultsMolli+3);
std::vector<TYPE> resultsShmolliVec(resultsShmolli, resultsShmolli+3);
for (int i = 0; i < 7; i++) {
EXPECT_EQ(testData.getSignalMag()[i], signalMagVec[i]);
EXPECT_EQ(testData.getSignalPha()[i], signalPhaVec[i]);
EXPECT_EQ(testData.getSigns()[i], signsVec[i]);
EXPECT_EQ(testData.getInvTimes()[i], invTimesVec[i]);
}
for (int i = 0; i < 3; i++) {
EXPECT_EQ(testData.getResultsMolli()[i], resultsMolliVec[i]);
EXPECT_EQ(testData.getResultsShmolli()[i], resultsShmolliVec[i]);
}
}