SpatialBox can be constructed via ctor with parameters (#3760)

This commit is contained in:
David Andrs 2026-01-31 16:02:39 -07:00 committed by GitHub
parent 7b4617affb
commit 6041ee6ae3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 0 deletions

View file

@ -1,4 +1,6 @@
#include "openmc/distribution.h"
#include "openmc/distribution_spatial.h"
#include "openmc/position.h"
#include "openmc/random_lcg.h"
#include <catch2/catch_test_macros.hpp>
#include <catch2/matchers/catch_matchers_floating_point.hpp>
@ -79,3 +81,14 @@ TEST_CASE("Test alias sampling method for pugixml constructor")
REQUIRE(dist.alias()[i] == correct_alias[i]);
}
}
TEST_CASE("Test construction of SpatialBox with parameters")
{
openmc::Position ll {-1, -2, -3};
openmc::Position ur {30, 15, 5};
openmc::SpatialBox box(ll, ur);
REQUIRE(box.lower_left() == openmc::Position {-1, -2, -3});
REQUIRE(box.upper_right() == openmc::Position {30, 15, 5});
REQUIRE_FALSE(box.only_fissionable());
}