diff --git a/tests/test_calculations.cpp b/tests/test_calculations.cpp index 292c127..af6bb3d 100644 --- a/tests/test_calculations.cpp +++ b/tests/test_calculations.cpp @@ -139,7 +139,7 @@ const lest::test specification[] = p.T = 2794.4822; EXPECT( rcompare( f(), 1.768018, 0.02) ); }, - CASE("dEdx for compunds"){ + CASE("dEdx for compounds"){ catima::Projectile p{1,1,1,1000}; catima::Material water({ {1.00794,1,2}, @@ -327,6 +327,15 @@ const lest::test specification[] = EXPECT(res0.sigma_r == res.results[0].sigma_r); EXPECT(res0.tof == res.results[0].tof); + }, + CASE("default material calculations"){ + catima::Projectile p{12,6,6,350}; + auto air = catima::get_material(catima::material::AIR); + air.thickness(0.500); + auto res = catima::calculate(p(350),air); + EXPECT(res.Eout == approx(345.6).epsilon(1e-2)); + EXPECT(res.sigma_a == approx(0.0013).epsilon(1e-2)); + EXPECT(res.sigma_E == approx(0.12).epsilon(1e-2)); } }; diff --git a/tests/test_structures.cpp b/tests/test_structures.cpp index 9b718d5..a9c83b2 100644 --- a/tests/test_structures.cpp +++ b/tests/test_structures.cpp @@ -181,6 +181,25 @@ const lest::test specification[] = mat5.add_element(12,6,1); EXPECT(mat5.ncomponents()==mat6.ncomponents()+1); + }, + CASE("int and double stn check"){ + catima::Projectile p{1,1,1,1000}; + catima::Material mat1({ + {12.01, 6, 1}, + {16.00, 8, 1} + }); + catima::Material mat2({ + {12.01, 6, 0.5}, + {16.00, 8, 0.5} + }); + mat1.thickness(1.0); + mat2.thickness(1.0); + auto res1 = catima::calculate(p(1000),mat1); + auto res2 = catima::calculate(p(1000),mat2); + EXPECT(res1.dEdxi == res2.dEdxi); + EXPECT(res1.range == res2.range); + EXPECT(res1.sigma_a == res2.sigma_a); + EXPECT(res1.sigma_r == res2.sigma_r); } };