Skip to content

Commit

Permalink
#2307: Add unit tests to check initial value of time parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
thearusable committed Jun 28, 2024
1 parent 03d4f7d commit 83bea28
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/unit/collection/test_lb_data_holder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,23 @@ TEST_F(TestLBDataHolder, test_lb_entity_attributes) {
EXPECT_EQ("abc", (*outJsonPtr)["tasks"][0]["attributes"]["stringSample"]);
}

TEST_F(TestLBDataHolder, test_default_time_format) {
using LBDataHolder = vt::vrt::collection::balance::LBDataHolder;

nlohmann::json json;
json["metadata"]["type"] = "LBDatafile";

addPhasesDataToJson(json, num_phases, {});

LBDataHolder testObj(json);
auto outJsonPtr = testObj.toJson(0);
ASSERT_TRUE(outJsonPtr != nullptr);

for (auto& task: (*outJsonPtr)["tasks"]) {
EXPECT_EQ(true, task["time"].is_number_float());
}
}

}}}} // end namespace vt::tests::unit::lb

#endif /*vt_check_enabled(lblite)*/

0 comments on commit 83bea28

Please sign in to comment.