void test1() { AlarmConfig alarmconfig; Oam oamapi; for( int alarmID = 1 ; alarmID < MAX_ALARM_ID; alarmID++) { oamapi.getAlarmConfig(alarmID, alarmconfig); Svalue = alarmconfig.BriefDesc; CPPUNIT_ASSERT(!Svalue.empty()); Svalue = alarmconfig.DetailedDesc; CPPUNIT_ASSERT(!Svalue.empty()); Svalue = alarmconfig.Severity; CPPUNIT_ASSERT(!Svalue.empty()); Ivalue = alarmconfig.Threshold; CPPUNIT_ASSERT(Ivalue != -1); Ivalue = alarmconfig.Occurrences; CPPUNIT_ASSERT(Ivalue != -1); Svalue = alarmconfig.LastIssueTime; CPPUNIT_ASSERT(!Svalue.empty()); } };
void test2() { Oam oamapi; oamapi.setAlarmConfig(CPU_USAGE_MED, "Threshold", 20); oamapi.getAlarmConfig(CPU_USAGE_MED, "Threshold", Ivalue); CPPUNIT_ASSERT(Ivalue == 20); };
void test3() { Oam oamapi; oamapi.getAlarmConfig(CPU_USAGE_MED, "ThresholdBAD", Ivalue); CPPUNIT_ASSERT(Ivalue == 0); };