Fixed unit tests

This commit is contained in:
Paolo Andreetto
2019-07-15 08:28:09 +00:00
parent 8fe8311483
commit 52d574e317
3 changed files with 7 additions and 40 deletions

View File

@@ -31,7 +31,6 @@
#include "Core/Object.h" #include "Core/Object.h"
#include "Core/Archives.h" #include "Core/Archives.h"
#include "ParticlePhysics/MuonTomography/MuonScatter.h"
#include "testing-prototype.h" #include "testing-prototype.h"
@@ -189,48 +188,12 @@ int testing_hrt_class() {
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// MUON SCATTER EXAMPLE //
int testing_mu()
{
std::stringstream ss;
MuonScatter mu;
mu.SetMomentumIn(555);
mu.SetMomentumOut(2368);
{
std::ofstream file("test.txt");
file << mu;
}
mu.SetMomentumIn(0);
mu.SetMomentumOut(0);
{
std::ifstream file("test.txt");
file >> mu;
}
std::cout << mu << "\n";
}
int main() { int main() {
BEGIN_TESTING(Serialize Test); BEGIN_TESTING(Serialize Test);
TEST1( test_V3f() ); TEST1( test_V3f() );
TEST1( testing_xml_class() ); TEST1( testing_xml_class() );
// testing_hrt_class(); ///// << ERRORE in HRT with properties // testing_hrt_class(); ///// << ERRORE in HRT with properties
TEST1( testing_mu() );
END_TESTING; END_TESTING;
} }

View File

@@ -237,9 +237,9 @@ public:
// std::cout << boost::mpl::at_c< BitSet,1 >::type::value << "\n"; // std::cout << boost::mpl::at_c< BitSet,1 >::type::value << "\n";
} }
int Get(unsigned short field) const { // int Get(unsigned short field) const {
return boost::mpl::at_c< BitSet, field >::type::value; // return boost::mpl::at_c< BitSet, field >::type::value;
} // }
}; };

View File

@@ -14,5 +14,9 @@ set(TESTS
BitCodeTest BitCodeTest
) )
set(LIBRARIES
${PACKAGE_LIBPREFIX}Core
${PACKAGE_LIBPREFIX}Math
)
uLib_add_tests(${uLib-module}) uLib_add_tests(${uLib-module})