43 lines
960 B
C++
43 lines
960 B
C++
#include <gtest/gtest.h>
|
|
|
|
#include "common/ceMatchedFilterHandling.h"
|
|
#include "MatlabReader.h"
|
|
|
|
inline double fourDecimalRound(double src){
|
|
return round(src*10000.0)/10000.0;
|
|
}
|
|
|
|
#define EXPECT_DOUBLE_AE(valueA,valueB)\
|
|
EXPECT_DOUBLE_EQ(fourDecimalRound(valueA),fourDecimalRound(valueB))
|
|
|
|
class Common_Test : public ::testing::Test {
|
|
protected:
|
|
static void SetUpCommonTester() {
|
|
|
|
}
|
|
|
|
static void TearDownTestCase() {
|
|
}
|
|
|
|
void SetUp() {
|
|
}
|
|
|
|
void TearDown() {
|
|
}
|
|
};
|
|
|
|
TEST_F(Common_Test, adaptFrequency) {
|
|
// MatlabReader m("/home/krad/TestData/adaptFrequency.mat");
|
|
MatlabReader m("/home/sun/Aurora/build/a.mat");
|
|
|
|
auto mCe = m.read("input");
|
|
mCe = Recon::adaptFrequency(mCe,40000000.0,10000000.0);
|
|
EXPECT_EQ(4096,mCe.getDataSize());
|
|
auto output = m.read("output");
|
|
for (size_t i = 0; i < 4096; i++)
|
|
{
|
|
EXPECT_DOUBLE_AE(mCe.getData()[i],output.getData()[i])<<", index:"<<i;
|
|
}
|
|
|
|
}
|