Docs., error checking and test improvements
* Update doc. on api-support function * Check for valid integer value when reading a monitor int. val. * If fan-write test attempts to set speed higher than max. possible, then skip the test Change-Id: I01ad0ab1f4caffdb0d2c26e9575f278c35a6b017
This commit is contained in:
@@ -89,6 +89,7 @@ void TestFanReadWrite::Run(void) {
|
||||
int64_t orig_speed;
|
||||
int64_t new_speed;
|
||||
int64_t cur_speed;
|
||||
uint64_t max_speed;
|
||||
|
||||
TestBase::Run();
|
||||
|
||||
@@ -107,8 +108,18 @@ void TestFanReadWrite::Run(void) {
|
||||
return;
|
||||
}
|
||||
|
||||
ret = rsmi_dev_fan_speed_max_get(dv_ind, 0, &max_speed);
|
||||
CHK_ERR_ASRT(ret)
|
||||
|
||||
new_speed = 1.1 * orig_speed;
|
||||
|
||||
if (new_speed > static_cast<int64_t>(max_speed)) {
|
||||
std::cout <<
|
||||
"***System fan speed value is close to max. Will not adjust upward." <<
|
||||
std::endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "Setting fan speed to " << new_speed << std::endl;
|
||||
}
|
||||
|
||||
مرجع در شماره جدید
Block a user