48 lines
1.2 KiB
C++
48 lines
1.2 KiB
C++
#include <gtest/gtest.h>
|
|
#include <limits>
|
|
|
|
#include "Function1D.h"
|
|
#include "MatlabReader.h"
|
|
#include "Matrix.h"
|
|
#include "transmissionReconstruction/reconstruction/reconstruction.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 Reconstruction_Test : public ::testing::Test {
|
|
protected:
|
|
static void SetUpReconstructionTester() {
|
|
|
|
}
|
|
|
|
static void TearDownTestCase() {
|
|
}
|
|
|
|
void SetUp() {
|
|
}
|
|
|
|
void TearDown() {
|
|
}
|
|
};
|
|
|
|
TEST_F(Reconstruction_Test, calculateMinimalMaximalTransducerPositions) {
|
|
auto senderList = Aurora::Matrix::fromRawData(new double[6]{1, 2, 3, 1, 2, 4}, 3, 2);
|
|
auto receiverList = Aurora::Matrix::fromRawData(new double[6]{1, 8, 3, 1, 2, 1}, 3, 2);
|
|
auto result = Recon::calculateMinimalMaximalTransducerPositions(senderList,receiverList);
|
|
EXPECT_DOUBLE_EQ(1.0,result.getData()[0]);
|
|
EXPECT_DOUBLE_EQ(2,result.getData()[1]);
|
|
EXPECT_DOUBLE_EQ(1.0,result.getData()[2]);
|
|
EXPECT_DOUBLE_EQ(1.0,result.getData()[3]);
|
|
EXPECT_DOUBLE_EQ(8,result.getData()[4]);
|
|
EXPECT_DOUBLE_EQ(4,result.getData()[5]);
|
|
|
|
|
|
}
|