Applied patches sent in by Kevin Gao.
diff --git a/testcases/open_hpi_testsuite/src/event_log_process/el_003.c b/testcases/open_hpi_testsuite/src/event_log_process/el_003.c
index ccfda30..ea568ae 100644
--- a/testcases/open_hpi_testsuite/src/event_log_process/el_003.c
+++ b/testcases/open_hpi_testsuite/src/event_log_process/el_003.c
@@ -27,7 +27,7 @@
SaErrorT val;
int ret = HPI_TEST_PASS;
- next_entry_id = SAHPI_NEWEST_ENTRY;
+ prev_entry_id = SAHPI_NEWEST_ENTRY;
while (next_entry_id != SAHPI_NO_MORE_ENTRIES) {
current_entry_id = prev_entry_id;
val = saHpiEventLogEntryGet(session_id,
diff --git a/testcases/open_hpi_testsuite/src/event_log_process/el_004.c b/testcases/open_hpi_testsuite/src/event_log_process/el_004.c
index dd2be0d..932afe4 100644
--- a/testcases/open_hpi_testsuite/src/event_log_process/el_004.c
+++ b/testcases/open_hpi_testsuite/src/event_log_process/el_004.c
@@ -18,20 +18,22 @@
#include <hpitest.h>
#define TEST_STR "Event log test str"
+#define TEST_ENTRY_ID 2
int process_domain_eventlog(SaHpiSessionIdT session_id)
{
+#if 0
SaHpiSelEntryIdT prev_entry_id;
SaHpiSelEntryIdT next_entry_id;
SaHpiSelEntryT entry_get, entry_add;
SaHpiRdrT rdr;
SaHpiRptEntryT rpt_entry1;
- SaErrorT val;
+#endif
+ SaHpiSelEntryT entry_add;
+ SaErrorT val;
int ret = HPI_TEST_PASS;
-/* I suppose that the function saHpiEventLogEntryAdd() will set rpt_entry_add
- * to then event log entry specified by its EntryId. If there is a entry used
- * the same ID, the function will override it with new entry we set. */
+#if 0
val = saHpiEventLogEntryGet(session_id, SAHPI_DOMAIN_CONTROLLER_ID,
SAHPI_NEWEST_ENTRY, &prev_entry_id, &next_entry_id,
&entry_add, &rdr, &rpt_entry1);
@@ -42,8 +44,11 @@
ret = HPI_TEST_FAIL;
goto out;
}
-
+#endif
+ /* We need to wait until the function saHpiEventLogEntryAdd has clear
+ * sytax.*/
memset(&entry_add, 0, sizeof(entry_add));
+ entry_add.EntryId = TEST_ENTRY_ID;
entry_add.Timestamp = SAHPI_TIME_UNSPECIFIED;
entry_add.Event.Source = SAHPI_UNSPECIFIED_RESOURCE_ID;
entry_add.Event.EventType = SAHPI_ET_USER;
@@ -60,7 +65,7 @@
ret = HPI_TEST_FAIL;
goto out;
}
-
+#if 0
val = saHpiEventLogEntryGet(session_id, SAHPI_DOMAIN_CONTROLLER_ID,
entry_add.EntryId, &prev_entry_id, &next_entry_id,
&entry_get, &rdr, &rpt_entry1);
@@ -77,7 +82,7 @@
printf(" Add event log entry function is invalid!\n");
ret = HPI_TEST_FAIL;
}
-
+#endif
out:
return ret;
}
diff --git a/testcases/open_hpi_testsuite/src/sensor_thresholds/sf_201.c b/testcases/open_hpi_testsuite/src/sensor_thresholds/sf_201.c
index f477e7d..3ba4b98 100644
--- a/testcases/open_hpi_testsuite/src/sensor_thresholds/sf_201.c
+++ b/testcases/open_hpi_testsuite/src/sensor_thresholds/sf_201.c
@@ -19,84 +19,86 @@
#define THRESHOLDS_TEST_DATA 2
-void value_init(SaHpiSensorThresholdsT *thresholds, SaHpiSensorThdDefnT defn)
+void set_data(SaHpiSensorReadingT *reading, SaHpiSensorReadingT *reading_old)
{
- SaHpiSensorThdMaskT read_thold = defn.ReadThold;
- SaHpiSensorThdMaskT write_thold = defn.WriteThold;
+ SaHpiSensorInterpretedTypeT type;
+
+ type = reading_old->Interpreted.Type;
+ reading->ValuesPresent = SAHPI_SRF_INTERPRETED;
+ reading->Interpreted.Type = type;
+
+ switch(type) {
+ case SAHPI_SENSOR_INTERPRETED_TYPE_UINT8:
+ reading->Interpreted.Value.SensorUint8 = THRESHOLDS_TEST_DATA;
+ break;
+ case SAHPI_SENSOR_INTERPRETED_TYPE_UINT16:
+ reading->Interpreted.Value.SensorUint16 = THRESHOLDS_TEST_DATA;
+ break;
+ case SAHPI_SENSOR_INTERPRETED_TYPE_UINT32:
+ reading->Interpreted.Value.SensorUint32 = THRESHOLDS_TEST_DATA;
+ break;
+ case SAHPI_SENSOR_INTERPRETED_TYPE_INT8:
+ reading->Interpreted.Value.SensorInt8 = THRESHOLDS_TEST_DATA;
+ break;
+ case SAHPI_SENSOR_INTERPRETED_TYPE_INT16:
+ reading->Interpreted.Value.SensorInt16 = THRESHOLDS_TEST_DATA;
+ break;
+ case SAHPI_SENSOR_INTERPRETED_TYPE_INT32:
+ reading->Interpreted.Value.SensorInt32 = THRESHOLDS_TEST_DATA;
+ break;
+ case SAHPI_SENSOR_INTERPRETED_TYPE_FLOAT32:
+ reading->Interpreted.Value.SensorFloat32 = THRESHOLDS_TEST_DATA;
+ break;
+ case SAHPI_SENSOR_INTERPRETED_TYPE_BUFFER:
+ memset(reading->Interpreted.Value.SensorBuffer, 0,
+ sizeof(reading->Interpreted
+ .Value.SensorBuffer));
+ reading->Interpreted.Value.SensorBuffer[0] =
+ THRESHOLDS_TEST_DATA;
+ break;
+ }
+}
+
+void value_init(SaHpiSensorThresholdsT *thresholds, SaHpiSensorThresholdsT
+ *thresholds_old, SaHpiSensorThdDefnT defn)
+{
+ SaHpiSensorThdMaskT read_thold = defn.ReadThold;
+ SaHpiSensorThdMaskT write_thold = defn.WriteThold;
if (read_thold & SAHPI_STM_LOW_CRIT &&
- write_thold & SAHPI_STM_LOW_CRIT) {
- thresholds->LowCritical.ValuesPresent = SAHPI_SRF_INTERPRETED;
- thresholds->LowCritical.Interpreted.Type =
- SAHPI_SENSOR_INTERPRETED_TYPE_UINT32;
- thresholds->LowCritical.Interpreted.Value.SensorUint32 =
- THRESHOLDS_TEST_DATA;
- }
+ write_thold & SAHPI_STM_LOW_CRIT)
+ set_data(&thresholds->LowCritical,
+ &thresholds_old->LowCritical);
if (read_thold & SAHPI_STM_LOW_MAJOR &&
- write_thold & SAHPI_STM_LOW_MAJOR) {
- thresholds->LowMajor.ValuesPresent = SAHPI_SRF_INTERPRETED;
- thresholds->LowMajor.Interpreted.Type =
- SAHPI_SENSOR_INTERPRETED_TYPE_UINT32;
- thresholds->LowMajor.Interpreted.Value.SensorUint32 =
- THRESHOLDS_TEST_DATA;
- }
+ write_thold & SAHPI_STM_LOW_MAJOR)
+ set_data(&thresholds->LowMajor, &thresholds_old->LowMajor);
if (read_thold & SAHPI_STM_LOW_MINOR &&
- write_thold & SAHPI_STM_LOW_MINOR) {
- thresholds->LowMinor.ValuesPresent = SAHPI_SRF_INTERPRETED;
- thresholds->LowMinor.Interpreted.Type =
- SAHPI_SENSOR_INTERPRETED_TYPE_UINT32;
- thresholds->LowMinor.Interpreted.Value.SensorUint32 =
- THRESHOLDS_TEST_DATA;
- }
+ write_thold & SAHPI_STM_LOW_MINOR)
+ set_data(&thresholds->LowMinor, &thresholds_old->LowMinor);
if (read_thold & SAHPI_STM_UP_CRIT &&
- write_thold & SAHPI_STM_UP_CRIT) {
- thresholds->UpCritical.ValuesPresent = SAHPI_SRF_INTERPRETED;
- thresholds->UpCritical.Interpreted.Type =
- SAHPI_SENSOR_INTERPRETED_TYPE_UINT32;
- thresholds->UpCritical.Interpreted.Value.SensorUint32 =
- THRESHOLDS_TEST_DATA;
- }
+ write_thold & SAHPI_STM_UP_CRIT)
+ set_data(&thresholds->UpCritical, &thresholds_old->UpCritical);
if (read_thold & SAHPI_STM_UP_MAJOR &&
- write_thold & SAHPI_STM_UP_MAJOR) {
- thresholds->UpMajor.ValuesPresent = SAHPI_SRF_INTERPRETED;
- thresholds->UpMajor.Interpreted.Type =
- SAHPI_SENSOR_INTERPRETED_TYPE_UINT32;
- thresholds->UpMajor.Interpreted.Value.SensorUint32 =
- THRESHOLDS_TEST_DATA;
- }
+ write_thold & SAHPI_STM_UP_MAJOR)
+ set_data(&thresholds->UpMajor, &thresholds_old->UpMajor);
if (read_thold & SAHPI_STM_UP_MINOR &&
- write_thold & SAHPI_STM_UP_MINOR) {
- thresholds->UpMinor.ValuesPresent = SAHPI_SRF_INTERPRETED;
- thresholds->UpMinor.Interpreted.Type =
- SAHPI_SENSOR_INTERPRETED_TYPE_UINT32;
- thresholds->UpMinor.Interpreted.Value.SensorUint32 =
- THRESHOLDS_TEST_DATA;
- }
+ write_thold & SAHPI_STM_UP_MINOR)
+ set_data(&thresholds->UpMinor, &thresholds_old->UpMinor);
if (read_thold & SAHPI_STM_UP_HYSTERESIS &&
- write_thold & SAHPI_STM_UP_HYSTERESIS) {
- thresholds->PosThdHysteresis.ValuesPresent =
- SAHPI_SRF_INTERPRETED;
- thresholds->PosThdHysteresis.Interpreted.Type =
- SAHPI_SENSOR_INTERPRETED_TYPE_UINT32;
- thresholds->PosThdHysteresis.Interpreted.Value.SensorUint32 =
- THRESHOLDS_TEST_DATA;
- }
+ write_thold & SAHPI_STM_UP_HYSTERESIS)
+ set_data(&thresholds->PosThdHysteresis,
+ &thresholds_old->PosThdHysteresis);
if (read_thold & SAHPI_STM_LOW_HYSTERESIS &&
- write_thold & SAHPI_STM_LOW_HYSTERESIS) {
- thresholds->NegThdHysteresis.ValuesPresent =
- SAHPI_SRF_INTERPRETED;
- thresholds->NegThdHysteresis.Interpreted.Type =
- SAHPI_SENSOR_INTERPRETED_TYPE_UINT32;
- thresholds->NegThdHysteresis.Interpreted.Value.SensorUint32 =
- THRESHOLDS_TEST_DATA;
- }
+ write_thold & SAHPI_STM_LOW_HYSTERESIS)
+ set_data(&thresholds->NegThdHysteresis,
+ &thresholds_old->NegThdHysteresis);
}
int thrd_cmp(SaHpiSensorThresholdsT thresholds, SaHpiSensorThresholdsT thresholds_new, SaHpiSensorThdDefnT defn)
@@ -191,6 +193,9 @@
if (rdr.RdrType == SAHPI_SENSOR_RDR) {
num = rdr.RdrTypeUnion.SensorRec.Num;
defn = rdr.RdrTypeUnion.SensorRec.ThresholdDefn;
+
+ if (defn.IsThreshold == SAHPI_FALSE)
+ goto out;
if (!defn.ReadThold || !defn.WriteThold)
goto out;
@@ -206,7 +211,7 @@
}
memset(&thresholds, 0, sizeof(thresholds));
- value_init(&thresholds, defn);
+ value_init(&thresholds, &thresholds_old, defn);
val = saHpiSensorThresholdsSet(session_id, resource_id,
num, &thresholds);
if (val != SA_OK) {
diff --git a/testcases/open_hpi_testsuite/src/sensor_thresholds/sf_202.c b/testcases/open_hpi_testsuite/src/sensor_thresholds/sf_202.c
index f706d6b..60cfb42 100644
--- a/testcases/open_hpi_testsuite/src/sensor_thresholds/sf_202.c
+++ b/testcases/open_hpi_testsuite/src/sensor_thresholds/sf_202.c
@@ -104,13 +104,20 @@
{
SaHpiSensorThresholdsT thresholds, thresholds_old, thresholds_new;
SaHpiSensorNumT num;
+ SaHpiSensorThdDefnT defn;
SaErrorT val;
int ret = HPI_TEST_UNKNOW;
if (rdr.RdrType == SAHPI_SENSOR_RDR) {
- ret = HPI_TEST_PASS;
num = rdr.RdrTypeUnion.SensorRec.Num;
-
+ defn = rdr.RdrTypeUnion.SensorRec.ThresholdDefn;
+
+ if (defn.IsThreshold == SAHPI_FALSE)
+ goto out;
+ if (!defn.ReadThold || !defn.WriteThold)
+ goto out;
+
+ ret = HPI_TEST_PASS;
val = saHpiSensorThresholdsGet(session_id, resource_id, num,
&thresholds_old);
if (val != SA_OK) {