Skip to content

Commit

Permalink
Fixed the test result when there is no emitted WLS photon
Browse files Browse the repository at this point in the history
  • Loading branch information
Soon Yung Jun committed Dec 3, 2024
1 parent e8b2e4f commit 390793f
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions test/celeritas/optical/WavelengthShift.test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,20 +144,13 @@ TEST_F(WavelengthShiftTest, wls_basic)

num_secondaries.push_back(num_emitted);

if (num_emitted == 0)
EXPECT_EQ(Interaction::Action::absorbed, result.action);
for (auto j : range(num_emitted))
{
EXPECT_EQ(Interaction::Action::unchanged, result.action);
}
else
{
EXPECT_EQ(Interaction::Action::absorbed, result.action);
for (auto j : range(num_emitted))
{
EXPECT_LT(result.secondaries[j].energy.value(), test_energy);
EXPECT_SOFT_EQ(0,
dot_product(result.secondaries[j].polarization,
result.secondaries[j].direction));
}
EXPECT_LT(result.secondaries[j].energy.value(), test_energy);
EXPECT_SOFT_EQ(0,
dot_product(result.secondaries[j].polarization,
result.secondaries[j].direction));
}
}
static size_type const expected_num_secondaries[] = {1, 4, 3, 0};
Expand Down

0 comments on commit 390793f

Please sign in to comment.