Skip to content

Commit

Permalink
#959 Update load model tests to call updateLoads()
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobDomagala committed Sep 11, 2020
1 parent aee3585 commit 3e0af58
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/unit/collection/test_model_comm_overhead.nompi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ TEST_F(TestModelCommOverhead, test_model_comm_overhead_1) {
{1, {TimeType{16.6}, TimeType{280}, TimeType{23}}}};

for (; num_phases < 2; ++num_phases) {
test_model->updateLoads(num_phases);
int objects_seen = 0;

for (auto&& obj : *test_model) {
EXPECT_TRUE(obj == 1 || obj == 2 || obj == 3);
++objects_seen;
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/collection/test_model_norm.nompi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ TEST_F(TestModelNorm, test_model_norm_1) {

auto test_model = std::make_shared<Norm>(std::make_shared<StubModel>(), 3.0);
test_model->setLoads(&proc_load, &proc_subphase_load, nullptr);
test_model->updateLoads(0);

for (unsigned int iter = 0; iter < num_subphases; ++iter) {
int objects_seen = 0;
Expand Down Expand Up @@ -155,6 +156,7 @@ TEST_F(TestModelNorm, test_model_norm_2) {
// finite 'power' value
auto test_model = std::make_shared<Norm>(std::make_shared<StubModel>(), 3.0);
test_model->setLoads(&proc_load, &proc_subphase_load, nullptr);
test_model->updateLoads(0);

std::array<TimeType, 2> expected_norms = {
TimeType{33.019}, TimeType{73.986}};
Expand Down Expand Up @@ -188,6 +190,7 @@ TEST_F(TestModelNorm, test_model_norm_3) {
auto test_model = std::make_shared<Norm>(
std::make_shared<StubModel>(), std::numeric_limits<double>::infinity());
test_model->setLoads(&proc_load, &proc_subphase_load, nullptr);
test_model->updateLoads(0);

std::array<TimeType, 2> expected_norms = {TimeType{30}, TimeType{60}};

Expand Down
2 changes: 2 additions & 0 deletions tests/unit/collection/test_model_select_subphases.nompi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ TEST_F(TestModelSelectSubphases, test_model_select_subphases_1) {
EXPECT_EQ(test_model->getNumSubphases(), subphases.size());

test_model->setLoads(&proc_load, &proc_subphase_load, nullptr);
test_model->updateLoads(0);

std::unordered_map<ElementIDType, std::vector<TimeType>> expected_values = {
{1,
Expand Down Expand Up @@ -174,6 +175,7 @@ TEST_F(TestModelSelectSubphases, test_model_select_subphases_2) {
EXPECT_EQ(test_model->getNumSubphases(), subphases.size());

test_model->setLoads(&proc_load, &proc_subphase_load, nullptr);
test_model->updateLoads(0);

std::unordered_map<ElementIDType, TimeType> expected_values = {
{1, TimeType{50}}, {2, TimeType{110}}};
Expand Down

0 comments on commit 3e0af58

Please sign in to comment.