Skip to content

Commit

Permalink
#1934: Update unit tests to use new constructor of LBDataHolder
Browse files Browse the repository at this point in the history
  • Loading branch information
thearusable committed Sep 23, 2024
1 parent f252c53 commit f519dca
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions tests/unit/collection/test_lb.extended.cc
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ TEST_F(TestRestoreLBData, test_restore_lb_data_data_1) {
);
});

vt::vrt::collection::balance::LBDataHolder lbdh;
vt::vrt::collection::balance::LBDataHolder lbdh(num_phases);
PhaseType write_phase = 0;

using CommKey = vt::elm::CommKey;
Expand Down Expand Up @@ -749,7 +749,7 @@ TEST_P(TestDumpUserdefinedData, test_dump_userdefined_json) {
);
});

vt::vrt::collection::balance::LBDataHolder lbdh;
vt::vrt::collection::balance::LBDataHolder lbdh(num_phases);
PhaseType write_phase = 0;

{
Expand Down Expand Up @@ -812,7 +812,7 @@ TEST_P(TestDumpAttributesFieldData, test_dump_attributes_json) {
);
});

vt::vrt::collection::balance::LBDataHolder lbdh;
vt::vrt::collection::balance::LBDataHolder lbdh(num_phases);
PhaseType phase = 0;

{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/collection/test_lb_data_holder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void addPhasesDataToJson(nlohmann::json& json, PhaseType amountOfPhasesToAdd, st
}
}

LBDataHolder dh;
LBDataHolder dh(amountOfPhasesToAdd);
for (unsigned i = 0; i < amountOfPhasesToAdd; i++) {
for (auto&& elm : ids[i]) {
dh.node_data_[i][elm] = LoadSummary{3.};
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/collection/test_workload_data_migrator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ setupWorkloads(PhaseType phase, size_t numElements) {
);
}

auto lbdh = std::make_shared<LBDataHolder>();
auto lbdh = std::make_shared<LBDataHolder>(1);

for (auto&& elmID : myElemList) {
double tval = elmID.id * 2;
Expand Down Expand Up @@ -790,7 +790,7 @@ setupManyWorkloads(
);
}

auto lbdh = std::make_shared<LBDataHolder>();
auto lbdh = std::make_shared<LBDataHolder>(num_phases);

PhaseType stop_phase = initial_phase + num_phases;
for (PhaseType phase = initial_phase; phase < stop_phase; ++phase) {
Expand All @@ -804,7 +804,7 @@ setupManyWorkloads(
}
}

auto scrambled_lbdh = std::make_shared<LBDataHolder>();
auto scrambled_lbdh = std::make_shared<LBDataHolder>(num_phases);

for (PhaseType phase = initial_phase; phase < stop_phase; ++phase) {
auto base_load_model = setupBaseModel(phase, lbdh);
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/lb/test_offlinelb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ TEST_F(TestOfflineLB, test_offlinelb_1) {
ids[5].push_back(nid);
}

LBDataHolder dh;
LBDataHolder dh(num_phases);
for (PhaseType i = 0; i < num_phases; i++) {
for (auto&& elm : ids[i]) {
dh.node_data_[i][elm] = LoadSummary{3};
Expand Down Expand Up @@ -196,7 +196,7 @@ TEST_F(TestOfflineLB, test_offlinelb_2) {
ids[7].push_back(nid);
}

LBDataHolder dh;
LBDataHolder dh(num_phases);
for (PhaseType i = 0; i < num_phases; i++) {
if (i != 1 and i != 2 and i != 5 and i != 8 and i != 9) {
auto& elms = ids[i];
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/runtime/test_initialization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ void prepareLBDataFiles(const std::string file_name_without_ext) {
ids[5].push_back(nid);
}

LBDataHolder dh;
LBDataHolder dh(num_phases);
for (PhaseType i = 0; i < num_phases; i++) {
for (auto&& elm : ids[i]) {
dh.node_data_[i][elm] = LoadSummary{3};
Expand Down

0 comments on commit f519dca

Please sign in to comment.