From 0cdb33819227971109c8a9b65db58e94303ea2bc Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Mon, 28 Oct 2024 11:16:30 -0500 Subject: [PATCH] add something that decays faster for Decay tests --- tests/material_tests.cc | 7 ++++++- tests/material_tests.h | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/material_tests.cc b/tests/material_tests.cc index c0200bf791..65920afdd0 100644 --- a/tests/material_tests.cc +++ b/tests/material_tests.cc @@ -215,11 +215,13 @@ TEST_F(MaterialTest, DecayResBuf) { double u235_qty = orig.mass(u235_); double pb208_qty = orig.mass(pb208_); double am241_qty = orig.mass(am241_); + double sr89_qty = orig.mass(sr89_); double orig_mass = tracked_mat_->quantity(); cyclus::toolkit::ResBuf res_buf; res_buf.Push(tracked_mat_); - res_buf.Decay(100); + // decay for 2 months which is just over 1 Sr-89 half-life + res_buf.Decay(2); cyclus::Material::Ptr pop_mat = res_buf.Pop(); // postquery @@ -229,6 +231,7 @@ TEST_F(MaterialTest, DecayResBuf) { EXPECT_NE(u235_qty, mq.mass(u235_)); EXPECT_NE(pb208_qty, mq.mass(pb208_)); EXPECT_NE(am241_qty, mq.mass(am241_)); + EXPECT_NE(sr89_qty, mq.mass(sr89_)); } TEST_F(MaterialTest, DecayManual) { @@ -237,6 +240,7 @@ TEST_F(MaterialTest, DecayManual) { double u235_qty = orig.mass(u235_); double pb208_qty = orig.mass(pb208_); double am241_qty = orig.mass(am241_); + double sr89_qty = orig.mass(sr89_); double orig_mass = tracked_mat_->quantity(); tracked_mat_->Decay(100); @@ -248,6 +252,7 @@ TEST_F(MaterialTest, DecayManual) { EXPECT_NE(u235_qty, mq.mass(u235_)); EXPECT_NE(pb208_qty, mq.mass(pb208_)); EXPECT_NE(am241_qty, mq.mass(am241_)); + EXPECT_NE(sr89_qty, mq.mass(sr89_)); } TEST_F(MaterialTest, DecayLazy) { diff --git a/tests/material_tests.h b/tests/material_tests.h index 0dff427cae..a562f21b3d 100644 --- a/tests/material_tests.h +++ b/tests/material_tests.h @@ -18,7 +18,7 @@ namespace cyclus { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - class MaterialTest : public ::testing::Test { protected: - Nuc u235_, am241_, th228_, pb208_, pu239_; + Nuc u235_, am241_, th228_, pb208_, pu239_, sr89_; int one_g_; // grams Composition::Ptr test_comp_, diff_comp_; double test_size_, fraction; @@ -56,6 +56,7 @@ class MaterialTest : public ::testing::Test { am241_ = 952410000; th228_ = 902280000; pb208_ = 822080000; + sr89_ = 380890000; test_size_ = 10 * units::g; fraction = 2.0 / 3.0; @@ -67,6 +68,7 @@ class MaterialTest : public ::testing::Test { v[u235_] = 1; v[pb208_] = 1; v[am241_] = 1; + v[sr89_] = 1; diff_comp_ = Composition::CreateFromMass(v); default_mat_ = Material::CreateUntracked(0 * units::g, test_comp_);