Skip to content

Commit

Permalink
Added min/max limit check for temperature in sysman temperature CTS (#74
Browse files Browse the repository at this point in the history
)

Related-To: VLCLJ-2296

Signed-off-by: Harini Kumaran <harini.kumaran@intel.com>
  • Loading branch information
harinik124 authored Oct 9, 2024
1 parent 38c4b52 commit b2d1710
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (C) 2020-2023 Intel Corporation
* Copyright (C) 2020-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
Expand All @@ -25,6 +25,9 @@ class TempModuleTest : public lzt::SysmanCtsClass {};
#define TEMPERATURE_TEST TempModuleTest
#endif // USE_ZESINIT

constexpr double max_valid_temperature = 125;
constexpr double min_valid_temperature = 10;

TEST_F(
TEMPERATURE_TEST,
GivenComponentCountZeroWhenRetrievingTempHandlesThenNonZeroCountIsReturned) {
Expand Down Expand Up @@ -252,8 +255,9 @@ TEST_F(TEMPERATURE_TEST,

for (auto temp_handle : temp_handles) {
ASSERT_NE(nullptr, temp_handle);
auto temp = lzt::get_temp_state(temp_handle);
EXPECT_GT(temp, 0);
auto current_temperature = lzt::get_temp_state(temp_handle);
EXPECT_GE(current_temperature, min_valid_temperature);
EXPECT_LE(current_temperature, max_valid_temperature);
}
}
}
Expand Down

0 comments on commit b2d1710

Please sign in to comment.