diff --git a/scripts/docker/ci/launch-testing.sh b/scripts/docker/ci/launch-testing.sh index 9d550210d9..d22a4675c0 100755 --- a/scripts/docker/ci/launch-testing.sh +++ b/scripts/docker/ci/launch-testing.sh @@ -1,11 +1,11 @@ -#!/bin/sh -ex +#!/bin/sh -e if [ -z "$1" ]; then echo "Usage: $0 pull-request-id" 1>&2 exit 2; fi -CONTAINER=$(docker run -t -d celeritas/ci-cuda11:latest) +CONTAINER=$(docker run -t -d celeritas/ci-cuda11:2021-01-27) echo "Launched container: ${CONTAINER}" docker exec -i $CONTAINER bash -l < - inline Collection(const Collection& other); + explicit inline Collection(const Collection& other); // Construct from another collection (mutable) template - inline Collection(Collection& other); + explicit inline Collection(Collection& other); //!@{ //! Default assignment @@ -133,13 +133,13 @@ class Collection Collection& operator=(Collection&& other) = default; //!@} - // Assign from another collection in the same memory space - template - inline Collection& operator=(const Collection& other); + // Assign from another collectio + template + inline Collection& operator=(const Collection& other); - // Assign (mutable!) from another collection in the same memory space - template - inline Collection& operator=(Collection& other); + // Assign (mutable!) from another collection + template + inline Collection& operator=(Collection& other); //// ACCESS //// diff --git a/src/base/Collection.i.hh b/src/base/Collection.i.hh index 9b44366b23..730c7a8097 100644 --- a/src/base/Collection.i.hh +++ b/src/base/Collection.i.hh @@ -37,12 +37,12 @@ Collection::Collection(Collection& other) //---------------------------------------------------------------------------// /*! - * Assign from another collection in the same memory space. + * Assign from another collection. */ template -template +template Collection& -Collection::operator=(const Collection& other) +Collection::operator=(const Collection& other) { storage_ = detail::CollectionAssigner()(other.storage_); detail::CollectionStorageValidator()(this->size(), @@ -52,12 +52,12 @@ Collection::operator=(const Collection& other) //---------------------------------------------------------------------------// /*! - * Assign (mutable!) from another collection in the same memory space. + * Assign (mutable!) from another collection. */ template -template +template Collection& -Collection::operator=(Collection& other) +Collection::operator=(Collection& other) { storage_ = detail::CollectionAssigner()(other.storage_); detail::CollectionStorageValidator()(this->size(), diff --git a/test/physics/em/LivermorePE.test.cc b/test/physics/em/LivermorePE.test.cc index f327fa4bd3..3e8453ed39 100644 --- a/test/physics/em/LivermorePE.test.cc +++ b/test/physics/em/LivermorePE.test.cc @@ -505,8 +505,10 @@ TEST_F(LivermorePEInteractorTest, model) EXPECT_EQ(1, grid_storage.size()); // Test cross sections calculated from tables + Collection real_ref{ + real_storage}; celeritas::XsCalculator calc_xs( - grid_storage[ValueGridInserter::XsIndex{0}], real_storage); + grid_storage[ValueGridInserter::XsIndex{0}], real_ref); EXPECT_SOFT_EQ(0.1, calc_xs(MevEnergy{1e-3})); EXPECT_SOFT_EQ(1e-5, calc_xs(MevEnergy{1e2})); EXPECT_SOFT_EQ(1e-9, calc_xs(MevEnergy{1e6})); diff --git a/test/physics/grid/NonuniformGrid.test.cc b/test/physics/grid/NonuniformGrid.test.cc index a73c8a352d..c0abe000a5 100644 --- a/test/physics/grid/NonuniformGrid.test.cc +++ b/test/physics/grid/NonuniformGrid.test.cc @@ -26,11 +26,16 @@ class NonuniformGridTest : public celeritas::Test { auto build = celeritas::make_builder(&data); irange = build.insert_back({0, 1, 3, 3, 7}); + ref = data; } celeritas::ItemRange irange; celeritas::Collection data; + celeritas::Collection + ref; }; //---------------------------------------------------------------------------// @@ -39,7 +44,7 @@ class NonuniformGridTest : public celeritas::Test TEST_F(NonuniformGridTest, accessors) { - GridT grid(irange, data); + GridT grid(irange, ref); EXPECT_EQ(5, grid.size()); EXPECT_EQ(0, grid.front()); @@ -50,7 +55,7 @@ TEST_F(NonuniformGridTest, accessors) TEST_F(NonuniformGridTest, find) { - GridT grid(irange, data); + GridT grid(irange, ref); #if CELERITAS_DEBUG EXPECT_THROW(grid.find(-1), celeritas::DebugError); diff --git a/test/physics/grid/ValueGridBuilder.test.cc b/test/physics/grid/ValueGridBuilder.test.cc index d5b152b39e..f96992ae5e 100644 --- a/test/physics/grid/ValueGridBuilder.test.cc +++ b/test/physics/grid/ValueGridBuilder.test.cc @@ -40,9 +40,11 @@ class ValueGridBuilderTest : public celeritas::Test { b->build(insert); } + real_ref = real_storage; } Collection real_storage; + Collection real_ref; Collection grid_storage; }; @@ -75,13 +77,13 @@ TEST_F(ValueGridBuilderTest, xs_grid) // Test results using the physics calculator ASSERT_EQ(2, grid_storage.size()); { - XsCalculator calc_xs(grid_storage[XsIndex{0}], real_storage); + XsCalculator calc_xs(grid_storage[XsIndex{0}], real_ref); EXPECT_SOFT_EQ(0.1, calc_xs(Energy{1e1})); EXPECT_SOFT_EQ(0.2, calc_xs(Energy{1e2})); EXPECT_SOFT_EQ(0.3, calc_xs(Energy{1e3})); } { - XsCalculator calc_xs(grid_storage[XsIndex{1}], real_storage); + XsCalculator calc_xs(grid_storage[XsIndex{1}], real_ref); EXPECT_SOFT_EQ(10., calc_xs(Energy{1e-3})); EXPECT_SOFT_EQ(1., calc_xs(Energy{1e-2})); EXPECT_SOFT_EQ(0.1, calc_xs(Energy{1e-1})); @@ -106,7 +108,7 @@ TEST_F(ValueGridBuilderTest, log_grid) // Test results using the physics calculator ASSERT_EQ(1, grid_storage.size()); { - XsCalculator calc_xs(grid_storage[XsIndex{0}], real_storage); + XsCalculator calc_xs(grid_storage[XsIndex{0}], real_ref); EXPECT_SOFT_EQ(0.1, calc_xs(Energy{1e1})); EXPECT_SOFT_EQ(0.2, calc_xs(Energy{1e2})); EXPECT_SOFT_EQ(0.3, calc_xs(Energy{1e3})); @@ -133,7 +135,7 @@ TEST_F(ValueGridBuilderTest, DISABLED_generic_grid) // Test results using the physics calculator ASSERT_EQ(2, grid_storage.size()); { - XsCalculator calc_xs(grid_storage[XsIndex{0}], real_storage); + XsCalculator calc_xs(grid_storage[XsIndex{0}], real_ref); EXPECT_SOFT_EQ(0.1, calc_xs(Energy{1e1})); EXPECT_SOFT_EQ(0.2, calc_xs(Energy{1e2})); EXPECT_SOFT_EQ(0.3, calc_xs(Energy{1e3}));