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
Bu işleme şunda yer alıyor:
Chris Freehill
2019-11-04 13:45:47 -06:00
ebeveyn 3a26a7270c
işleme 52dfa4bcca
5 değiştirilmiş dosya ile 37 ekleme ve 0 silme
+12
Dosyayı Görüntüle
@@ -140,5 +140,17 @@ int ReadSysfsStr(std::string path, std::string *retStr) {
return ret;
}
bool IsInteger(const std::string & n_str)
{
if(n_str.empty() || ((!isdigit(n_str[0])) && (n_str[0] != '-')
&& (n_str[0] != '+'))) {
return false;
}
char * tmp;
strtol(n_str.c_str(), &tmp, 10);
return (*tmp == 0);
}
} // namespace smi
} // namespace amd