libalaudio  1.14.5
tests/alacousticalspace_test.cpp
00001 
00006 #include "gtest/gtest.h"
00007 #include "../alacousticalspace.h"
00008 
00009 #include <almath/alrandom.h>
00010 #include <alvalue/alvalue.h>
00011 using boost::shared_ptr;
00012 
00013 TEST(test_space, Init) {
00014 
00015   boost::shared_ptr<ALAcousticalSpace> space = boost::shared_ptr<ALAcousticalSpace>( new ALAcousticalSpace() );
00016 
00017   std::vector<AL::Math::Position3D> vector;
00018   std::vector<AL::Math::Position3D> vectorCalib;
00019 
00020   space->getVertexMesh(vector);
00021   space->getVertexMeshCalibration(vectorCalib);
00022 
00023   EXPECT_EQ((int)vector.size(), 258 ) << "size of mesh vector not good";
00024   EXPECT_EQ((int)vectorCalib.size(), 6 ) << "size of mesh vectorCalib not good";
00025 
00026   EXPECT_EQ(vectorCalib[0].x, 1 ) << "vector for calibration not good : [0], x";
00027   EXPECT_EQ(vectorCalib[0].y, 0 ) << "vector for calibration not good : [0], y";
00028   EXPECT_EQ(vectorCalib[0].z, 0 ) << "vector for calibration not good : [0], z";
00029 
00030   EXPECT_EQ(vectorCalib[1].x, 0 ) << "vector for calibration not good : [1], x";
00031   EXPECT_EQ(vectorCalib[1].y, 1 ) << "vector for calibration not good : [1], y";
00032   EXPECT_EQ(vectorCalib[1].z, 0 ) << "vector for calibration not good : [1], z";
00033 
00034   EXPECT_EQ(vectorCalib[2].x,-1 ) << "vector for calibration not good : [2], x";
00035   EXPECT_EQ(vectorCalib[2].y, 0 ) << "vector for calibration not good : [2], y";
00036   EXPECT_EQ(vectorCalib[2].z, 0 ) << "vector for calibration not good : [2], z";
00037 
00038   EXPECT_EQ(vectorCalib[3].x, 0 ) << "vector for calibration not good : [3], x";
00039   EXPECT_EQ(vectorCalib[3].y,-1 ) << "vector for calibration not good : [3], y";
00040   EXPECT_EQ(vectorCalib[3].z, 0 ) << "vector for calibration not good : [3], z";
00041 
00042   EXPECT_EQ(vectorCalib[4].x, 0 ) << "vector for calibration not good : [4], x";
00043   EXPECT_EQ(vectorCalib[4].y, 0 ) << "vector for calibration not good : [4], y";
00044   EXPECT_EQ(vectorCalib[4].z, 1 ) << "vector for calibration not good : [4], z";
00045 
00046   EXPECT_EQ(vectorCalib[5].x, 0 ) << "vector for calibration not good : [5], x";
00047   EXPECT_EQ(vectorCalib[5].y, 0 ) << "vector for calibration not good : [5], y";
00048   EXPECT_EQ(vectorCalib[5].z,-1 ) << "vector for calibration not good : [5], z";
00049 }
 All Classes Files Functions