/*test case:test the reaction of the system called with an activation of a task*/ static void test_t9_instance(void) { StatusType result_inst_1, result_inst_2, result_inst_3, result_inst_4, result_inst_5, result_inst_6, result_inst_7, result_inst_8, result_inst_9; SCHEDULING_CHECK_INIT(88); result_inst_1 = ClearEvent(Task9_Event1); SCHEDULING_CHECK_AND_EQUAL_INT(88,E_OK , result_inst_1); SCHEDULING_CHECK_INIT(89); result_inst_2 = ClearEvent(Task9_Event2); SCHEDULING_CHECK_AND_EQUAL_INT(89,E_OK , result_inst_2); SCHEDULING_CHECK_INIT(90); result_inst_3 = ClearEvent(Task9_Event3); SCHEDULING_CHECK_AND_EQUAL_INT(90,E_OK , result_inst_3); SCHEDULING_CHECK_INIT(91); result_inst_4 = ClearEvent(Task9_Event4); SCHEDULING_CHECK_AND_EQUAL_INT(91,E_OK , result_inst_4); SCHEDULING_CHECK_INIT(92); result_inst_5 = ClearEvent(Task9_Event5); SCHEDULING_CHECK_AND_EQUAL_INT(92,E_OK , result_inst_5); SCHEDULING_CHECK_INIT(93); result_inst_6 = ClearEvent(Task9_Event6); SCHEDULING_CHECK_AND_EQUAL_INT(93,E_OK , result_inst_6); SCHEDULING_CHECK_INIT(94); result_inst_7 = ClearEvent(Task9_Event7); SCHEDULING_CHECK_AND_EQUAL_INT(94,E_OK , result_inst_7); SCHEDULING_CHECK_INIT(95); result_inst_8 = ClearEvent(Task9_Event8); SCHEDULING_CHECK_AND_EQUAL_INT(95,E_OK , result_inst_8); SCHEDULING_CHECK_INIT(96); result_inst_9 = TerminateTask(); SCHEDULING_CHECK_AND_EQUAL_INT(96,E_OK , result_inst_9); }
/*test case:test the reaction of the system called with an activation of a task*/ static void test_t2_instance(void) { StatusType result_inst_1, result_inst_2, result_inst_3, result_inst_4, result_inst_5, result_inst_6, result_inst_7, result_inst_8, result_inst_9; SCHEDULING_CHECK_INIT(25); result_inst_1 = ClearEvent(Task2_Event1); SCHEDULING_CHECK_AND_EQUAL_INT(25,E_OK , result_inst_1); SCHEDULING_CHECK_INIT(26); result_inst_2 = ClearEvent(Task2_Event2); SCHEDULING_CHECK_AND_EQUAL_INT(26,E_OK , result_inst_2); SCHEDULING_CHECK_INIT(27); result_inst_3 = ClearEvent(Task2_Event3); SCHEDULING_CHECK_AND_EQUAL_INT(27,E_OK , result_inst_3); SCHEDULING_CHECK_INIT(28); result_inst_4 = ClearEvent(Task2_Event4); SCHEDULING_CHECK_AND_EQUAL_INT(28,E_OK , result_inst_4); SCHEDULING_CHECK_INIT(29); result_inst_5 = ClearEvent(Task2_Event5); SCHEDULING_CHECK_AND_EQUAL_INT(29,E_OK , result_inst_5); SCHEDULING_CHECK_INIT(30); result_inst_6 = ClearEvent(Task2_Event6); SCHEDULING_CHECK_AND_EQUAL_INT(30,E_OK , result_inst_6); SCHEDULING_CHECK_INIT(31); result_inst_7 = ClearEvent(Task2_Event7); SCHEDULING_CHECK_AND_EQUAL_INT(31,E_OK , result_inst_7); SCHEDULING_CHECK_INIT(32); result_inst_8 = ClearEvent(Task2_Event8); SCHEDULING_CHECK_AND_EQUAL_INT(32,E_OK , result_inst_8); SCHEDULING_CHECK_INIT(33); result_inst_9 = TerminateTask(); SCHEDULING_CHECK_AND_EQUAL_INT(33,E_OK , result_inst_9); }
/*test case:test the reaction of the system called with an activation of a task*/ static void test_t6_instance(void) { StatusType result_inst_1, result_inst_2, result_inst_3, result_inst_4, result_inst_5, result_inst_6, result_inst_7, result_inst_8, result_inst_9; SCHEDULING_CHECK_INIT(61); result_inst_1 = ClearEvent(Task6_Event1); SCHEDULING_CHECK_AND_EQUAL_INT(61,E_OK , result_inst_1); SCHEDULING_CHECK_INIT(62); result_inst_2 = ClearEvent(Task6_Event2); SCHEDULING_CHECK_AND_EQUAL_INT(62,E_OK , result_inst_2); SCHEDULING_CHECK_INIT(63); result_inst_3 = ClearEvent(Task6_Event3); SCHEDULING_CHECK_AND_EQUAL_INT(63,E_OK , result_inst_3); SCHEDULING_CHECK_INIT(64); result_inst_4 = ClearEvent(Task6_Event4); SCHEDULING_CHECK_AND_EQUAL_INT(64,E_OK , result_inst_4); SCHEDULING_CHECK_INIT(65); result_inst_5 = ClearEvent(Task6_Event5); SCHEDULING_CHECK_AND_EQUAL_INT(65,E_OK , result_inst_5); SCHEDULING_CHECK_INIT(66); result_inst_6 = ClearEvent(Task6_Event6); SCHEDULING_CHECK_AND_EQUAL_INT(66,E_OK , result_inst_6); SCHEDULING_CHECK_INIT(67); result_inst_7 = ClearEvent(Task6_Event7); SCHEDULING_CHECK_AND_EQUAL_INT(67,E_OK , result_inst_7); SCHEDULING_CHECK_INIT(68); result_inst_8 = ClearEvent(Task6_Event8); SCHEDULING_CHECK_AND_EQUAL_INT(68,E_OK , result_inst_8); SCHEDULING_CHECK_INIT(69); result_inst_9 = TerminateTask(); SCHEDULING_CHECK_AND_EQUAL_INT(69,E_OK , result_inst_9); }
/*test case:test the reaction of the system called with an activation of a task*/ static void test_t1_instance1(void) { ApplicationType result_app_1; StatusType result_inst_1, result_inst_2, result_inst_3, result_inst_4, result_inst_5, result_inst_6, result_inst_7; ScheduleTableStatusType ScheduleTableStatusType_inst_1; TickType TickType_inst_1; SCHEDULING_CHECK_INIT(1); result_app_1 = GetApplicationID(); SCHEDULING_CHECK_AND_EQUAL_INT(1, app1, result_app_1); SCHEDULING_CHECK_INIT(2); result_inst_1 = SetRelAlarm(Alarm1, 1, 0); SCHEDULING_CHECK_AND_EQUAL_INT(2, E_OK, result_inst_1); SCHEDULING_CHECK_INIT(3); result_inst_2 = GetAlarm(Alarm1, &TickType_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT(3, E_OK, result_inst_2); SCHEDULING_CHECK_INIT(4); result_inst_3 = StartScheduleTableAbs(sched1, 0); SCHEDULING_CHECK_AND_EQUAL_INT(4, E_OK, result_inst_3); SCHEDULING_CHECK_INIT(5); result_inst_4 = GetScheduleTableStatus(sched1, &ScheduleTableStatusType_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(5 , SCHEDULETABLE_RUNNING , ScheduleTableStatusType_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT(5, E_OK, result_inst_4); SCHEDULING_CHECK_INIT(6); result_inst_5 = GetResource(Resource1); SCHEDULING_CHECK_AND_EQUAL_INT(6, E_OK, result_inst_5); SCHEDULING_CHECK_INIT(7); result_inst_6 = TerminateApplication(INVALID_RESTART); SCHEDULING_CHECK_AND_EQUAL_INT(8, E_OS_VALUE, result_inst_6); SCHEDULING_CHECK_INIT(9); result_inst_7 = TerminateApplication(RESTART); SCHEDULING_CHECK_AND_EQUAL_INT(90, E_OK, result_inst_7); }
/*test case:test the reaction of the system called with an activation of a task*/ static void test_t1_instance(void) { StatusType result_inst_2, result_inst_3, result_inst_4, result_inst_5, result_inst_6, result_inst_7, result_inst_8, result_inst_9; TaskStateType result_inst_3_5; SCHEDULING_CHECK_INIT(1); result_inst_2 = ActivateTask(INVALID_TASK); SCHEDULING_CHECK_AND_EQUAL_INT(1,E_OS_ID, result_inst_2); SCHEDULING_CHECK_INIT(2); result_inst_3 = GetTaskState(INVALID_TASK,&result_inst_3_5); SCHEDULING_CHECK_AND_EQUAL_INT(2,E_OS_ID, result_inst_3); SCHEDULING_CHECK_INIT(3); result_inst_4 = ChainTask(INVALID_TASK); SCHEDULING_CHECK_AND_EQUAL_INT(3,E_OS_ID, result_inst_4); SCHEDULING_CHECK_INIT(4); result_inst_5 = ActivateTask(t2); SCHEDULING_CHECK_AND_EQUAL_INT(8,E_OK, result_inst_5); SCHEDULING_CHECK_INIT(9); result_inst_6 = GetResource(RES_SCHEDULER); SCHEDULING_CHECK_AND_EQUAL_INT(9,E_OK, result_inst_6); SCHEDULING_CHECK_INIT(10); result_inst_7 = TerminateTask(); SCHEDULING_CHECK_AND_EQUAL_INT(10,E_OS_RESOURCE, result_inst_7); SCHEDULING_CHECK_INIT(11); result_inst_8 = ChainTask(t2); SCHEDULING_CHECK_AND_EQUAL_INT(11,E_OS_RESOURCE, result_inst_8); SCHEDULING_CHECK_INIT(12); result_inst_9 = ReleaseResource(RES_SCHEDULER); SCHEDULING_CHECK_AND_EQUAL_INT(12,E_OK, result_inst_9); tpl_send_it1(); SCHEDULING_CHECK_STEP(17); }
/*test case:test the reaction of the system called with an activation of a task*/ static void test_t1_instance(void) { StatusType result_inst_1; SCHEDULING_CHECK_STEP(1); WaitActivationOneShotAlarm(Alarm1); SCHEDULING_CHECK_STEP(3); WaitActivationPeriodicAlarm(Alarm2); SCHEDULING_CHECK_INIT(5); result_inst_1 = CancelAlarm(Alarm2); SCHEDULING_CHECK_AND_EQUAL_INT(5,E_OK, result_inst_1); SCHEDULING_CHECK_STEP(6); }
/*test case:test the reaction of the system called with an activation of a task*/ static void test_t1_instance(void) { StatusType result_inst_1,result_inst_2,result_inst_3,result_inst_4,result_inst_5,result_inst_6,result_inst_7,result_inst_8; SCHEDULING_CHECK_INIT(1); result_inst_1 = ActivateTask(t2); SCHEDULING_CHECK_AND_EQUAL_INT(1,E_OK , result_inst_1); SCHEDULING_CHECK_INIT(2); result_inst_2 = ActivateTask(t3); SCHEDULING_CHECK_AND_EQUAL_INT(2,E_OK , result_inst_2); SCHEDULING_CHECK_INIT(3); result_inst_3 = ActivateTask(t4); SCHEDULING_CHECK_AND_EQUAL_INT(3,E_OK , result_inst_3); SCHEDULING_CHECK_INIT(4); result_inst_4 = ActivateTask(t5); SCHEDULING_CHECK_AND_EQUAL_INT(4,E_OK , result_inst_4); SCHEDULING_CHECK_INIT(5); result_inst_5 = ActivateTask(t6); SCHEDULING_CHECK_AND_EQUAL_INT(5,E_OK , result_inst_5); SCHEDULING_CHECK_INIT(6); result_inst_6 = ActivateTask(t7); SCHEDULING_CHECK_AND_EQUAL_INT(6,E_OK , result_inst_6); SCHEDULING_CHECK_INIT(7); result_inst_7 = ActivateTask(t8); SCHEDULING_CHECK_AND_EQUAL_INT(7,E_OK , result_inst_7); SCHEDULING_CHECK_INIT(8); result_inst_8 = TerminateTask(); SCHEDULING_CHECK_AND_EQUAL_INT(8,E_OK , result_inst_8); }
static void test_t2_instance2(void) { Std_ReturnType result_inst_1, result_inst_2, result_inst_3, result_inst_4, result_inst_5, result_inst_6; TestType1 data1 = 0x00; TestType2 data2; data2.a=0x00; data2.b=0x00; SCHEDULING_CHECK_INIT(23); result_inst_1 = IocReceive_ioc1(&data1); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(23,IOC_E_LOST_DATA, result_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT(23,0x01, data1); SCHEDULING_CHECK_INIT(24); result_inst_2 = IocReceive_ioc1(&data1); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(24,IOC_E_OK, result_inst_2); SCHEDULING_CHECK_AND_EQUAL_INT(24,0x02, data1); SCHEDULING_CHECK_INIT(25); result_inst_3 = IocReceive_ioc1(&data1); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(25,IOC_E_OK, result_inst_3); SCHEDULING_CHECK_AND_EQUAL_INT(25,0x03, data1); SCHEDULING_CHECK_INIT(26); result_inst_4 = IocReceive_ioc1(&data1); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(26,IOC_E_OK, result_inst_4); SCHEDULING_CHECK_AND_EQUAL_INT(26,0x04, data1); SCHEDULING_CHECK_INIT(27); result_inst_5 = IocReceive_ioc1(&data1); SCHEDULING_CHECK_AND_EQUAL_INT(27,IOC_E_NO_DATA, result_inst_5); SCHEDULING_CHECK_INIT(28); result_inst_6 = IocReceive_ioc3(&data2); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(28,IOC_E_LOST_DATA, result_inst_6); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(28,0x01, data2.a); SCHEDULING_CHECK_AND_EQUAL_INT(28,0x02, data2.b); SCHEDULING_CHECK_STEP(29); TerminateTask(); }
/*test case:test the reaction of the system called with an activation of a task*/ static void test_t1_instance(void) { StatusType result_inst_1, result_inst_2, result_inst_3, result_inst_4, result_inst_5, result_inst_7; TickType result_inst_6; SCHEDULING_CHECK_INIT(1); result_inst_1 = SetAbsAlarm(Alarm1, 2, 2); SCHEDULING_CHECK_AND_EQUAL_INT(1,E_OK, result_inst_1); SCHEDULING_CHECK_INIT(2); result_inst_2 = SetAbsAlarm(Alarm1, 3, 0); SCHEDULING_CHECK_AND_EQUAL_INT(2,E_OS_STATE, result_inst_2); WaitActivationPeriodicAlarm(Alarm1); SCHEDULING_CHECK_STEP(4); WaitActivationPeriodicAlarm(Alarm1); SCHEDULING_CHECK_INIT(6); result_inst_3 = CancelAlarm(Alarm1); SCHEDULING_CHECK_AND_EQUAL_INT(6,E_OK, result_inst_3); SCHEDULING_CHECK_INIT(7); result_inst_4 = SetRelAlarm(Alarm1, 2, 0); SCHEDULING_CHECK_AND_EQUAL_INT(7,E_OK, result_inst_4); SCHEDULING_CHECK_INIT(8); result_inst_5 = SetRelAlarm(Alarm1, 3, 0); SCHEDULING_CHECK_AND_EQUAL_INT(8,E_OS_STATE, result_inst_5); SCHEDULING_CHECK_INIT(9); result_inst_7 = GetAlarm(Alarm1, &result_inst_6); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(9,2, result_inst_6); SCHEDULING_CHECK_AND_EQUAL_INT(9,E_OK, result_inst_7); WaitActivationOneShotAlarm(Alarm1); SCHEDULING_CHECK_STEP(11); }
/*test case:test the reaction of the system called with an activation of a task*/ static void test_error_instance(void) { StatusType result_inst_1, result_inst_2, result_inst_3, result_inst_4, result_inst_5, result_inst_6; TaskType task_id; TaskStateType task_state; EventMaskType event_mask; AlarmBaseType alarm_base; TickType tik; SCHEDULING_CHECK_INIT(4); result_inst_1 = GetActiveApplicationMode(); SCHEDULING_CHECK_AND_EQUAL_INT(4,OSDEFAULTAPPMODE , result_inst_1); SCHEDULING_CHECK_INIT(5); result_inst_2 = GetTaskID(&task_id); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(5,E_OK , result_inst_2); SCHEDULING_CHECK_AND_EQUAL_INT(5,t1 , task_id); SCHEDULING_CHECK_INIT(6); result_inst_3 = GetTaskState(task_id, &task_state); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(6,E_OK , result_inst_3); SCHEDULING_CHECK_AND_EQUAL_INT(6,RUNNING , task_state); SCHEDULING_CHECK_INIT(7); result_inst_4 = GetEvent(task_id,&event_mask); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(7,E_OK , result_inst_2); SCHEDULING_CHECK_AND_EQUAL_INT(7,E_OK , result_inst_2); SCHEDULING_CHECK_INIT(8); result_inst_5 = GetAlarmBase(Alarm1, &alarm_base); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(8,OSMAXALLOWEDVALUE_Counter1, (int)(alarm_base.maxallowedvalue)); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(8,OSTICKSPERBASE_Counter1, (int)(alarm_base.ticksperbase)); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(8,OSMINCYCLE_Counter1, (int)(alarm_base.mincycle)); SCHEDULING_CHECK_AND_EQUAL_INT(8,E_OK , result_inst_5); SCHEDULING_CHECK_INIT(9); result_inst_6 = GetAlarm(Alarm1,&tik); SCHEDULING_CHECK_AND_EQUAL_INT(9,E_OK , result_inst_6); }
/*test case:test the reaction of the system called with an activation of a task*/ static void test_protection_instance1(void) { SCHEDULING_CHECK_INIT(10); SCHEDULING_CHECK_AND_EQUAL_INT(10, E_OS_PROTECTION_TIME, Fatalerrorstatus); }
/*test case:test the reaction of the system called with an activation of a task*/ static void test_t1_instance(void) { AlarmBaseType AlarmBaseType_inst_1; EventMaskType EventMaskType_inst_1; StatusType result_inst_2, result_inst_3, result_inst_4, result_inst_5, result_inst_6, result_inst_7, result_inst_8, result_inst_9, result_inst_10, result_inst_11, result_inst_12, result_inst_13, result_inst_14, result_inst_15, result_inst_16, result_inst_17, result_inst_18, result_inst_19; TaskStateType TaskStateType_inst_1; TaskType TaskType_inst_1; TickType TickType_inst_1; SCHEDULING_CHECK_STEP(1); SCHEDULING_CHECK_STEP(2); SuspendAllInterrupts(); SCHEDULING_CHECK_INIT(3); result_inst_2 = ActivateTask(t2); SCHEDULING_CHECK_AND_EQUAL_INT(4,E_OS_DISABLEDINT, result_inst_2); SCHEDULING_CHECK_INIT(5); result_inst_3 = TerminateTask(); SCHEDULING_CHECK_AND_EQUAL_INT(6,E_OS_DISABLEDINT, result_inst_3); SCHEDULING_CHECK_INIT(7); result_inst_4 = ChainTask(t2); SCHEDULING_CHECK_AND_EQUAL_INT(8,E_OS_DISABLEDINT, result_inst_4); SCHEDULING_CHECK_INIT(9); result_inst_5 = Schedule(); SCHEDULING_CHECK_AND_EQUAL_INT(10,E_OS_DISABLEDINT, result_inst_5); SCHEDULING_CHECK_INIT(11); result_inst_6 = GetTaskID(&TaskType_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT(12,E_OS_DISABLEDINT, result_inst_6); SCHEDULING_CHECK_INIT(13); result_inst_7 = GetTaskState(t2, &TaskStateType_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT(14,E_OS_DISABLEDINT, result_inst_7); SCHEDULING_CHECK_INIT(15); result_inst_8 = GetResource(Resource1); SCHEDULING_CHECK_AND_EQUAL_INT(16,E_OS_DISABLEDINT, result_inst_8); SCHEDULING_CHECK_INIT(17); result_inst_9 = ReleaseResource(Resource1); SCHEDULING_CHECK_AND_EQUAL_INT(18,E_OS_DISABLEDINT, result_inst_9); SCHEDULING_CHECK_INIT(19); result_inst_10 = SetEvent(t2, Event1); SCHEDULING_CHECK_AND_EQUAL_INT(20,E_OS_DISABLEDINT, result_inst_10); SCHEDULING_CHECK_INIT(21); result_inst_11 = ClearEvent(Event1); SCHEDULING_CHECK_AND_EQUAL_INT(22,E_OS_DISABLEDINT, result_inst_11); SCHEDULING_CHECK_INIT(23); result_inst_12 = GetEvent(t2, &EventMaskType_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT(24,E_OS_DISABLEDINT, result_inst_12); SCHEDULING_CHECK_INIT(25); result_inst_13 = WaitEvent(Event1); SCHEDULING_CHECK_AND_EQUAL_INT(26,E_OS_DISABLEDINT, result_inst_13); SCHEDULING_CHECK_INIT(27); result_inst_14 = GetAlarmBase(Alarm1, &AlarmBaseType_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT(28,E_OS_DISABLEDINT, result_inst_14); SCHEDULING_CHECK_INIT(29); result_inst_15 = GetAlarm(Alarm1, &TickType_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT(30,E_OS_DISABLEDINT, result_inst_15); SCHEDULING_CHECK_INIT(31); result_inst_16 = SetRelAlarm(Alarm1, 1, 0); SCHEDULING_CHECK_AND_EQUAL_INT(32,E_OS_DISABLEDINT, result_inst_16); SCHEDULING_CHECK_INIT(33); result_inst_17 = SetAbsAlarm(Alarm1, 1, 0); SCHEDULING_CHECK_AND_EQUAL_INT(34,E_OS_DISABLEDINT, result_inst_17); SCHEDULING_CHECK_INIT(35); result_inst_18 = CancelAlarm(Alarm1); SCHEDULING_CHECK_AND_EQUAL_INT(36,E_OS_DISABLEDINT, result_inst_18); SCHEDULING_CHECK_INIT(37); result_inst_19 = GetActiveApplicationMode(); SCHEDULING_CHECK_AND_EQUAL_INT(38,OSDEFAULTAPPMODE, result_inst_19); SCHEDULING_CHECK_STEP(39); ResumeAllInterrupts(); }
/*test case:test the reaction of the system called with an activation of a task*/ static void test_isr1_instance(void) { StatusType result_inst_1, result_inst_2, result_inst_3, result_inst_4, result_inst_5, result_inst_6, result_inst_7, result_inst_8, result_inst_9, result_inst_10, result_inst_11; TickType TickType_inst_1, TickType_inst_2, TickType_inst_3, TickType_inst_4, TickType_inst_6, TickType_inst_8, TickType_inst_9, TickType_inst_10, tick_temp; TickType TickType_inst_5 = OSMAXALLOWEDVALUE_Software_Counter + 1; TickType TickType_inst_7 = OSMAXALLOWEDVALUE_Hardware_Counter + 1; TickType alarm_increment = 2; EventMaskType EventMaskType_inst_1; SCHEDULING_CHECK_INIT(2); result_inst_1 = GetCounterValue(Hardware_Counter, &TickType_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT(2,E_OK, result_inst_1); WaitCounterDeltaValue(Hardware_Counter, 3); SCHEDULING_CHECK_INIT(3); result_inst_2 = GetCounterValue(Hardware_Counter, &TickType_inst_2); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(3, (TickType_inst_1 + 3)%(OSMAXALLOWEDVALUE_Hardware_Counter + 1) , TickType_inst_2); SCHEDULING_CHECK_AND_EQUAL_INT(3,E_OK , result_inst_2); SCHEDULING_CHECK_INIT(4); result_inst_3 = SetRelAlarm(Alarm1, alarm_increment, 0); SCHEDULING_CHECK_AND_EQUAL_INT(4,E_OK, result_inst_3); WaitActivationOneShotAlarm(Alarm1); SCHEDULING_CHECK_INIT(5); tick_temp = TickType_inst_2; result_inst_4 = GetElapsedCounterValue(Hardware_Counter, &TickType_inst_2, &TickType_inst_3); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(5,E_OK , result_inst_4); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(5,(tick_temp + alarm_increment)%(OSMAXALLOWEDVALUE_Hardware_Counter + 1) , TickType_inst_2); SCHEDULING_CHECK_AND_EQUAL_INT(5,alarm_increment , TickType_inst_3); SCHEDULING_CHECK_INIT(6); result_inst_5 = GetEvent(t1, &EventMaskType_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(6,Event1 , EventMaskType_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT(6,E_OK , result_inst_5); SCHEDULING_CHECK_INIT(7); result_inst_6 = IncrementCounter(Hardware_Counter); SCHEDULING_CHECK_AND_EQUAL_INT(7,E_OS_ID, result_inst_6); SCHEDULING_CHECK_INIT(8); result_inst_7 = IncrementCounter(INVALID_COUNTER); SCHEDULING_CHECK_AND_EQUAL_INT(8,E_OS_ID, result_inst_7); SCHEDULING_CHECK_INIT(9); result_inst_8 = GetCounterValue(INVALID_COUNTER, &TickType_inst_4); SCHEDULING_CHECK_AND_EQUAL_INT(9,E_OS_ID, result_inst_8); SCHEDULING_CHECK_INIT(10); result_inst_9 = GetElapsedCounterValue(Software_Counter, &TickType_inst_5, &TickType_inst_6); SCHEDULING_CHECK_AND_EQUAL_INT(10,E_OS_VALUE, result_inst_9); SCHEDULING_CHECK_INIT(11); result_inst_10 = GetElapsedCounterValue(Hardware_Counter, &TickType_inst_7, &TickType_inst_8); SCHEDULING_CHECK_AND_EQUAL_INT(11,E_OS_VALUE, result_inst_10); SCHEDULING_CHECK_INIT(12); result_inst_11 = GetElapsedCounterValue(INVALID_COUNTER, &TickType_inst_9, &TickType_inst_10); SCHEDULING_CHECK_AND_EQUAL_INT(12,E_OS_ID, result_inst_11); }
/*test case:test the reaction of the system called with an activation of a task*/ static void test_t1_instance(void) { StatusType result_inst_1, result_inst_2, result_inst_3, result_inst_4, result_inst_5, result_inst_6, result_inst_7, result_inst_8, result_inst_9, result_inst_10, result_inst_11, result_inst_12, result_inst_13, result_inst_14, result_inst_15; ScheduleTableStatusType ScheduleTableStatusType_inst_1, ScheduleTableStatusType_inst_2, ScheduleTableStatusType_inst_3, ScheduleTableStatusType_inst_4, ScheduleTableStatusType_inst_5, ScheduleTableStatusType_inst_6; SCHEDULING_CHECK_INIT(1); result_inst_1 = ActivateTask(t3); SCHEDULING_CHECK_AND_EQUAL_INT(2, E_OK, result_inst_1); SCHEDULING_CHECK_INIT(3); result_inst_2 = GetScheduleTableStatus(sched1, &ScheduleTableStatusType_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(3, SCHEDULETABLE_STOPPED , ScheduleTableStatusType_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT(3,E_OK, result_inst_2); SCHEDULING_CHECK_INIT(4); result_inst_3 = StartScheduleTableRel(sched1, 1); SCHEDULING_CHECK_AND_EQUAL_INT(4,E_OK, result_inst_3); SCHEDULING_CHECK_INIT(5); result_inst_4 = GetScheduleTableStatus(sched1, &ScheduleTableStatusType_inst_2); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(5, SCHEDULETABLE_RUNNING , ScheduleTableStatusType_inst_2); SCHEDULING_CHECK_AND_EQUAL_INT(5,E_OK, result_inst_4); SCHEDULING_CHECK_INIT(6); result_inst_5 = IncrementCounter(Software_Counter); /*start schedule table (because StartScheduleTabelRel(x, 1))*/ /*offset = 0+offset_sched -> t5 and t3 */ SCHEDULING_CHECK_AND_EQUAL_INT(9,E_OK, result_inst_5); SCHEDULING_CHECK_INIT(10); result_inst_6 = IncrementCounter(Software_Counter); /*offset = 1+offset_sched -> t4 and t3 */ SCHEDULING_CHECK_AND_EQUAL_INT(13,E_OK, result_inst_6); SCHEDULING_CHECK_INIT(14); result_inst_7 = GetScheduleTableStatus(sched1, &ScheduleTableStatusType_inst_3); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(14, SCHEDULETABLE_RUNNING , ScheduleTableStatusType_inst_3); SCHEDULING_CHECK_AND_EQUAL_INT(14,E_OK, result_inst_7); SCHEDULING_CHECK_INIT(15); result_inst_8 = IncrementCounter(Software_Counter); /*offset = 2+offset_sched*/ SCHEDULING_CHECK_AND_EQUAL_INT(15,E_OK, result_inst_8); SCHEDULING_CHECK_INIT(16); result_inst_9 = GetScheduleTableStatus(sched1, &ScheduleTableStatusType_inst_4); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(16, SCHEDULETABLE_RUNNING , ScheduleTableStatusType_inst_4); SCHEDULING_CHECK_AND_EQUAL_INT(16,E_OK, result_inst_9); SCHEDULING_CHECK_INIT(17); result_inst_10 = IncrementCounter(Software_Counter); /*offset = 3+offset_sched*/ SCHEDULING_CHECK_AND_EQUAL_INT(17,E_OK, result_inst_10); SCHEDULING_CHECK_INIT(18); result_inst_11 = GetScheduleTableStatus(sched1, &ScheduleTableStatusType_inst_5); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(18, SCHEDULETABLE_STOPPED , ScheduleTableStatusType_inst_5); SCHEDULING_CHECK_AND_EQUAL_INT(18,E_OK, result_inst_11); SCHEDULING_CHECK_INIT(19); result_inst_12 = StartScheduleTableRel(sched2, 1); SCHEDULING_CHECK_AND_EQUAL_INT(19,E_OK, result_inst_12); SCHEDULING_CHECK_INIT(20); result_inst_13 = IncrementCounter(Software_Counter); /*start schedule table (because StartScheduleTabelRel(x, 1))*/ SCHEDULING_CHECK_AND_EQUAL_INT(20,E_OK, result_inst_13); SCHEDULING_CHECK_INIT(21); result_inst_14 = IncrementCounter(Software_Counter); /*offset = 1+offset_sched -> t3 and t2 */ SCHEDULING_CHECK_AND_EQUAL_INT(24,E_OK, result_inst_14); SCHEDULING_CHECK_INIT(25); result_inst_15 = GetScheduleTableStatus(sched2, &ScheduleTableStatusType_inst_6); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(25, SCHEDULETABLE_STOPPED , ScheduleTableStatusType_inst_6); SCHEDULING_CHECK_AND_EQUAL_INT(25,E_OK, result_inst_15); }
static void test_t1_instance(void) { Std_ReturnType result_inst_1, result_inst_2, result_inst_3, result_inst_5, result_inst_6, result_inst_7, result_inst_8, result_inst_10, result_inst_11, result_inst_12; StatusType result_inst_4, result_inst_9, result_inst_13; TestType1 data1 = 0x01; TestType2 data2; data2.a=0x01; data2.b=0x02; /* test SendGroup */ SCHEDULING_CHECK_INIT(1); result_inst_1 = IocSendGroup_ioc1(data1, &data2); SCHEDULING_CHECK_AND_EQUAL_INT(1,IOC_E_OK, result_inst_1); SCHEDULING_CHECK_INIT(2); data1=0x02; data2.a=0x03; data2.b=0x04; result_inst_2 = IocSendGroup_ioc1(data1, &data2); SCHEDULING_CHECK_AND_EQUAL_INT(2,IOC_E_OK, result_inst_2); SCHEDULING_CHECK_INIT(3); data1=0x03; data2.a=0x05; data2.b=0x06; result_inst_3 = IocSendGroup_ioc1(data1, &data2); SCHEDULING_CHECK_AND_EQUAL_INT(3,IOC_E_OK, result_inst_3); SCHEDULING_CHECK_INIT(4); result_inst_4 = ActivateTask(t2); SCHEDULING_CHECK_AND_EQUAL_INT(9,E_OK, result_inst_4); /* test SendGroup overflow */ SCHEDULING_CHECK_INIT(10); data1=0x01; data2.a=0x01; data2.b=0x02; result_inst_5 = IocSendGroup_ioc1(data1, &data2); SCHEDULING_CHECK_AND_EQUAL_INT(10,IOC_E_OK, result_inst_5); SCHEDULING_CHECK_INIT(11); data1=0x02; data2.a=0x03; data2.b=0x04; result_inst_6 = IocSendGroup_ioc1(data1, &data2); SCHEDULING_CHECK_AND_EQUAL_INT(11,IOC_E_OK, result_inst_6); SCHEDULING_CHECK_INIT(12); data1=0x03; data2.a=0x05; data2.b=0x06; result_inst_7 = IocSendGroup_ioc1(data1, &data2); SCHEDULING_CHECK_AND_EQUAL_INT(12,IOC_E_OK, result_inst_7); SCHEDULING_CHECK_INIT(13); data1=0x04; data2.a=0x07; data2.b=0x08; result_inst_8 = IocSendGroup_ioc1(data1, &data2); SCHEDULING_CHECK_AND_EQUAL_INT(13,IOC_E_LIMIT, result_inst_8); SCHEDULING_CHECK_INIT(14); result_inst_9 = ActivateTask(t2); SCHEDULING_CHECK_AND_EQUAL_INT(17,E_OK, result_inst_9); SCHEDULING_CHECK_INIT(18); result_inst_10 = IocEmptyQueue_ioc1(); SCHEDULING_CHECK_AND_EQUAL_INT(18,IOC_E_OK, result_inst_10); SCHEDULING_CHECK_INIT(19); data1=0x01; data2.a=0x01; data2.b=0x02; result_inst_11 = IocSendGroup_ioc1(data1, &data2); SCHEDULING_CHECK_AND_EQUAL_INT(19,IOC_E_OK, result_inst_11); SCHEDULING_CHECK_INIT(20); result_inst_12 = IocEmptyQueue_ioc1(); SCHEDULING_CHECK_AND_EQUAL_INT(20,IOC_E_OK, result_inst_12); SCHEDULING_CHECK_INIT(21); result_inst_13 = ActivateTask(t2); SCHEDULING_CHECK_AND_EQUAL_INT(23,E_OK, result_inst_13); SCHEDULING_CHECK_STEP(24); }
/*test case:test the reaction of the system called with an activation of a task*/ static void test_isr1_instance(void) { StatusType result_inst_1, result_inst_1_5, result_inst_2, result_inst_3, result_inst_4, result_inst_5, result_inst_6, result_inst_7, result_inst_8, result_inst_9, result_inst_10, result_inst_11, result_inst_12, result_inst_13, result_inst_14, result_inst_15; StatusType result_inst_16, result_inst_17, result_inst_18, result_inst_19, result_inst_20, result_inst_21, result_inst_22, result_inst_23, result_inst_24, result_inst_25, result_inst_26, result_inst_27, result_inst_28, result_inst_29, result_inst_30, result_inst_31, result_inst_32, result_inst_33, result_inst_34, result_inst_35; AlarmBaseType alarmbase; TickType tik; SCHEDULING_CHECK_INIT(2); result_inst_1 = ActivateTask(t4); SCHEDULING_CHECK_AND_EQUAL_INT(2,E_OK, result_inst_1); SCHEDULING_CHECK_INIT(3); result_inst_1_5 = ActivateTask(t3); SCHEDULING_CHECK_AND_EQUAL_INT(3,E_OK, result_inst_1_5); SCHEDULING_CHECK_INIT(4); result_inst_2 = GetAlarmBase(INVALID_ALARM, &alarmbase); SCHEDULING_CHECK_AND_EQUAL_INT(4,E_OS_ID, result_inst_2); SCHEDULING_CHECK_INIT(5); result_inst_3 = GetAlarmBase(Alarm0, &alarmbase); SCHEDULING_CHECK_AND_EQUAL_INT(5,E_OK, result_inst_3); SCHEDULING_CHECK_INIT(6); result_inst_4 = GetAlarm(INVALID_ALARM, &tik); SCHEDULING_CHECK_AND_EQUAL_INT(6,E_OS_ID, result_inst_4); SCHEDULING_CHECK_INIT(7); result_inst_5 = GetAlarm(Alarm0, &tik); SCHEDULING_CHECK_AND_EQUAL_INT(7,E_OS_NOFUNC, result_inst_5); SCHEDULING_CHECK_INIT(8); result_inst_6 = SetRelAlarm(INVALID_ALARM, 0, 0); SCHEDULING_CHECK_AND_EQUAL_INT(8,E_OS_ID, result_inst_6); SCHEDULING_CHECK_INIT(9); result_inst_7 = SetRelAlarm(Alarm0, -1 , 0); SCHEDULING_CHECK_AND_EQUAL_INT(9,E_OS_VALUE, result_inst_7); SCHEDULING_CHECK_INIT(10); result_inst_8 = SetRelAlarm(Alarm0, alarmbase.maxallowedvalue + 1 , 0); SCHEDULING_CHECK_AND_EQUAL_INT(10,E_OS_VALUE, result_inst_8); SCHEDULING_CHECK_INIT(11); result_inst_9 = SetRelAlarm(Alarm0, 0 , alarmbase.mincycle - 1); SCHEDULING_CHECK_AND_EQUAL_INT(11,E_OS_VALUE, result_inst_9); SCHEDULING_CHECK_INIT(12); result_inst_10 = SetRelAlarm(Alarm0, 0 , alarmbase.maxallowedvalue + 1); SCHEDULING_CHECK_AND_EQUAL_INT(12,E_OS_VALUE, result_inst_10); SCHEDULING_CHECK_INIT(13); result_inst_11 = SetAbsAlarm(INVALID_ALARM, 0, 0); SCHEDULING_CHECK_AND_EQUAL_INT(13,E_OS_ID, result_inst_11); SCHEDULING_CHECK_INIT(14); result_inst_12 = SetAbsAlarm(Alarm0, -1 , 0); SCHEDULING_CHECK_AND_EQUAL_INT(14,E_OS_VALUE, result_inst_12); SCHEDULING_CHECK_INIT(15); result_inst_13 = SetAbsAlarm(Alarm0, alarmbase.maxallowedvalue + 1 , 0); SCHEDULING_CHECK_AND_EQUAL_INT(15,E_OS_VALUE, result_inst_13); SCHEDULING_CHECK_INIT(16); result_inst_14 = SetAbsAlarm(Alarm0, 0 , alarmbase.mincycle - 1); SCHEDULING_CHECK_AND_EQUAL_INT(16,E_OS_VALUE, result_inst_14); SCHEDULING_CHECK_INIT(17); result_inst_15 = SetAbsAlarm(Alarm0, 0 , alarmbase.maxallowedvalue + 1); SCHEDULING_CHECK_AND_EQUAL_INT(17,E_OS_VALUE, result_inst_15); SCHEDULING_CHECK_INIT(18); result_inst_16 = CancelAlarm(INVALID_ALARM); SCHEDULING_CHECK_AND_EQUAL_INT(18,E_OS_ID, result_inst_16); SCHEDULING_CHECK_INIT(19); result_inst_17 = CancelAlarm(Alarm0); SCHEDULING_CHECK_AND_EQUAL_INT(19,E_OS_NOFUNC, result_inst_17); SCHEDULING_CHECK_INIT(20); result_inst_18 = SetRelAlarm(Alarm1_1, 2 , 2); SCHEDULING_CHECK_AND_EQUAL_INT(20,E_OK, result_inst_18); SCHEDULING_CHECK_INIT(21); result_inst_19 = SetRelAlarm(Alarm1_1, 2 , 2); SCHEDULING_CHECK_AND_EQUAL_INT(21,E_OS_STATE, result_inst_19); SCHEDULING_CHECK_INIT(22); result_inst_20 = GetAlarm(Alarm1_1, &tik); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(22,E_OK, result_inst_20); SCHEDULING_CHECK_AND_EQUAL_INT(22,2, tik); WaitActivationPeriodicAlarm(Alarm1_1); SCHEDULING_CHECK_INIT(23); result_inst_21 = CancelAlarm(Alarm1_1); SCHEDULING_CHECK_AND_EQUAL_INT(23,E_OK, result_inst_21); SCHEDULING_CHECK_INIT(24); result_inst_22 = SetAbsAlarm(Alarm1_2, 2 , 0); SCHEDULING_CHECK_AND_EQUAL_INT(24,E_OK, result_inst_22); SCHEDULING_CHECK_INIT(25); result_inst_23 = SetAbsAlarm(Alarm1_2, 2 , 2); SCHEDULING_CHECK_AND_EQUAL_INT(25,E_OS_STATE, result_inst_23); WaitActivationOneShotAlarm(Alarm1_2); SCHEDULING_CHECK_INIT(26); result_inst_24 = SetRelAlarm(Alarm2_1, 2 , 2); SCHEDULING_CHECK_AND_EQUAL_INT(26,E_OK, result_inst_24); SCHEDULING_CHECK_INIT(27); result_inst_25 = SetRelAlarm(Alarm2_1, 2 , 2); SCHEDULING_CHECK_AND_EQUAL_INT(27,E_OS_STATE, result_inst_25); SCHEDULING_CHECK_INIT(28); result_inst_26 = GetAlarm(Alarm2_1, &tik); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(28,E_OK, result_inst_26); SCHEDULING_CHECK_AND_EQUAL_INT(28,2, tik); WaitActivationPeriodicAlarm(Alarm2_1); SCHEDULING_CHECK_INIT(29); result_inst_27 = CancelAlarm(Alarm2_1); SCHEDULING_CHECK_AND_EQUAL_INT(29,E_OK, result_inst_27); SCHEDULING_CHECK_INIT(30); result_inst_28 = SetAbsAlarm(Alarm2_2, 2 , 0); SCHEDULING_CHECK_AND_EQUAL_INT(30,E_OK, result_inst_28); SCHEDULING_CHECK_INIT(31); result_inst_29 = SetAbsAlarm(Alarm2_2, 2 , 2); SCHEDULING_CHECK_AND_EQUAL_INT(31,E_OS_STATE, result_inst_29); WaitActivationOneShotAlarm(Alarm2_2); SCHEDULING_CHECK_INIT(32); result_inst_30 = SetRelAlarm(Alarm3, 2 , 2); SCHEDULING_CHECK_AND_EQUAL_INT(32,E_OK, result_inst_30); SCHEDULING_CHECK_INIT(33); result_inst_31 = SetRelAlarm(Alarm3, 2 , 2); SCHEDULING_CHECK_AND_EQUAL_INT(33,E_OS_STATE, result_inst_31); SCHEDULING_CHECK_INIT(34); result_inst_32 = GetAlarm(Alarm3, &tik); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(34,E_OK, result_inst_32); SCHEDULING_CHECK_AND_EQUAL_INT(34,2, tik); WaitActivationPeriodicAlarm(Alarm3); SCHEDULING_CHECK_INIT(36); result_inst_33 = CancelAlarm(Alarm3); SCHEDULING_CHECK_AND_EQUAL_INT(36,E_OK, result_inst_33); SCHEDULING_CHECK_INIT(37); result_inst_34 = SetAbsAlarm(Alarm3, 2 , 0); SCHEDULING_CHECK_AND_EQUAL_INT(37,E_OK, result_inst_34); SCHEDULING_CHECK_INIT(38); result_inst_35 = SetAbsAlarm(Alarm3, 2 , 2); SCHEDULING_CHECK_AND_EQUAL_INT(38,E_OS_STATE, result_inst_35); WaitActivationOneShotAlarm(Alarm3); SCHEDULING_CHECK_STEP(40); }
/*test case:test the reaction of the system called with an activation of a task*/ static void test_t1_instance(void) { StatusType result_inst_1, result_inst_2, result_inst_3; SCHEDULING_CHECK_STEP(1); SuspendAllInterrupts(); SCHEDULING_CHECK_INIT(2); result_inst_1 = ActivateTask(t2); SCHEDULING_CHECK_AND_EQUAL_INT(2,E_OS_DISABLEDINT, result_inst_1); SCHEDULING_CHECK_STEP(3); sendSoftwareIt(0, SOFT_IRQ0); SCHEDULING_CHECK_STEP(4); ResumeOSInterrupts(); SCHEDULING_CHECK_STEP(5); EnableAllInterrupts(); SCHEDULING_CHECK_STEP(6); ResumeAllInterrupts(); SCHEDULING_CHECK_STEP(8); SuspendOSInterrupts(); SCHEDULING_CHECK_INIT(9); result_inst_2 = ActivateTask(t2); SCHEDULING_CHECK_AND_EQUAL_INT(9,E_OS_DISABLEDINT, result_inst_2); SCHEDULING_CHECK_STEP(10); sendSoftwareIt(0, SOFT_IRQ0); SCHEDULING_CHECK_STEP(11); ResumeAllInterrupts(); SCHEDULING_CHECK_STEP(12); EnableAllInterrupts(); SCHEDULING_CHECK_STEP(13); DisableAllInterrupts(); SCHEDULING_CHECK_STEP(14); EnableAllInterrupts(); SCHEDULING_CHECK_STEP(15); ResumeOSInterrupts(); SCHEDULING_CHECK_STEP(17); DisableAllInterrupts(); SCHEDULING_CHECK_INIT(18); result_inst_3 = ActivateTask(t2); SCHEDULING_CHECK_AND_EQUAL_INT(18,E_OS_DISABLEDINT, result_inst_3); SCHEDULING_CHECK_STEP(19); sendSoftwareIt(0, SOFT_IRQ0); SCHEDULING_CHECK_STEP(20); ResumeAllInterrupts(); SCHEDULING_CHECK_STEP(21); ResumeOSInterrupts(); SCHEDULING_CHECK_STEP(22); EnableAllInterrupts(); SCHEDULING_CHECK_STEP(24); }
/*test case:test the reaction of the system called with an activation of a task*/ static void test_t1_instance(void) { StatusType result_inst_2, result_inst_4, result_inst_6, result_inst_7, result_inst_8, result_inst_9, result_inst_10, result_inst_11, result_inst_12, result_inst_13, result_inst_14, result_inst_15, result_inst_16, result_inst_17; AlarmBaseType result_inst_1, result_inst_5; TickType result_inst_3; SCHEDULING_CHECK_INIT(1); result_inst_2 = GetAlarmBase(INVALID_ALARM, &result_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT(1,E_OS_ID, result_inst_2); SCHEDULING_CHECK_INIT(2); result_inst_4 = GetAlarm(INVALID_ALARM, &result_inst_3); SCHEDULING_CHECK_AND_EQUAL_INT(2,E_OS_ID, result_inst_4); SCHEDULING_CHECK_INIT(3); result_inst_6 = GetAlarmBase(Alarm1, &result_inst_5); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(3,OSMAXALLOWEDVALUE, (int)(result_inst_5.maxallowedvalue)); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(3,OSTICKSPERBASE, (int)(result_inst_5.ticksperbase)); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(3,OSMINCYCLE, (int)(result_inst_5.mincycle)); SCHEDULING_CHECK_AND_EQUAL_INT(3,E_OK, result_inst_6); SCHEDULING_CHECK_INIT(4); result_inst_7 = SetRelAlarm(INVALID_ALARM, 0, 0); SCHEDULING_CHECK_AND_EQUAL_INT(4,E_OS_ID, result_inst_7); SCHEDULING_CHECK_INIT(5); result_inst_8 = SetRelAlarm(Alarm1, -1, 0); SCHEDULING_CHECK_AND_EQUAL_INT(5,E_OS_VALUE, result_inst_8); SCHEDULING_CHECK_INIT(6); result_inst_9 = SetRelAlarm(Alarm1, result_inst_5.maxallowedvalue + 1, 0); SCHEDULING_CHECK_AND_EQUAL_INT(6,E_OS_VALUE, result_inst_9); SCHEDULING_CHECK_INIT(7); result_inst_10 = SetRelAlarm(Alarm1, 0, result_inst_5.mincycle - 1); SCHEDULING_CHECK_AND_EQUAL_INT(7,E_OS_VALUE, result_inst_10); SCHEDULING_CHECK_INIT(8); result_inst_11 = SetRelAlarm(Alarm1, 0, result_inst_5.maxallowedvalue + 1); SCHEDULING_CHECK_AND_EQUAL_INT(8,E_OS_VALUE, result_inst_11); SCHEDULING_CHECK_INIT(9); result_inst_12 = SetAbsAlarm(INVALID_ALARM, 0, 0); SCHEDULING_CHECK_AND_EQUAL_INT(9,E_OS_ID, result_inst_12); SCHEDULING_CHECK_INIT(10); result_inst_13 = SetAbsAlarm(Alarm1, -1, 0); SCHEDULING_CHECK_AND_EQUAL_INT(10,E_OS_VALUE, result_inst_13); SCHEDULING_CHECK_INIT(11); result_inst_14 = SetAbsAlarm(Alarm1, result_inst_5.maxallowedvalue + 1, 0); SCHEDULING_CHECK_AND_EQUAL_INT(11,E_OS_VALUE, result_inst_14); SCHEDULING_CHECK_INIT(12); result_inst_15 = SetAbsAlarm(Alarm1, 0, result_inst_5.mincycle - 1); SCHEDULING_CHECK_AND_EQUAL_INT(12,E_OS_VALUE, result_inst_15); SCHEDULING_CHECK_INIT(13); result_inst_16 = SetAbsAlarm(Alarm1, 0, result_inst_5.maxallowedvalue + 1); SCHEDULING_CHECK_AND_EQUAL_INT(13,E_OS_VALUE, result_inst_16); SCHEDULING_CHECK_INIT(14); result_inst_17 = CancelAlarm(INVALID_ALARM); SCHEDULING_CHECK_AND_EQUAL_INT(14,E_OS_ID, result_inst_17); }
/*test case:test the reaction of the system called with an activation of a task*/ static void test_t1_instance(void) { StatusType result_inst_1, result_inst_2, result_inst_3, result_inst_4, result_inst_5, result_inst_6, result_inst_7, result_inst_8, result_inst_9, result_inst_10, result_inst_11, result_inst_12, result_inst_13, result_inst_14, result_inst_15; SCHEDULING_CHECK_INIT(1); result_inst_1 = StartScheduleTableSynchron(INVALID_SCHEDULETABLE); SCHEDULING_CHECK_AND_EQUAL_INT(2,E_OS_ID, result_inst_1); SCHEDULING_CHECK_INIT(3); result_inst_2 = StartScheduleTableSynchron(sched_implicit); SCHEDULING_CHECK_AND_EQUAL_INT(4,E_OS_ID, result_inst_2); SCHEDULING_CHECK_INIT(5); result_inst_3 = StartScheduleTableSynchron(sched_nosync); SCHEDULING_CHECK_AND_EQUAL_INT(6,E_OS_ID, result_inst_3); SCHEDULING_CHECK_INIT(7); result_inst_4 = SyncScheduleTable(INVALID_SCHEDULETABLE, 1); SCHEDULING_CHECK_AND_EQUAL_INT(8,E_OS_ID, result_inst_4); SCHEDULING_CHECK_INIT(9); result_inst_5 = SyncScheduleTable(sched_implicit, 1); SCHEDULING_CHECK_AND_EQUAL_INT(10,E_OS_ID, result_inst_5); SCHEDULING_CHECK_INIT(11); result_inst_6 = SyncScheduleTable(sched_nosync, 1); SCHEDULING_CHECK_AND_EQUAL_INT(12,E_OS_ID, result_inst_6); SCHEDULING_CHECK_INIT(13); result_inst_7 = SyncScheduleTable(sched_explicit, 1); SCHEDULING_CHECK_AND_EQUAL_INT(14,E_OS_STATE, result_inst_7); SCHEDULING_CHECK_INIT(15); result_inst_8 = StartScheduleTableSynchron(sched_explicit); SCHEDULING_CHECK_AND_EQUAL_INT(15,E_OK, result_inst_8); SCHEDULING_CHECK_INIT(16); result_inst_9 = NextScheduleTable(sched_explicit, sched_explicit_next); SCHEDULING_CHECK_AND_EQUAL_INT(16,E_OK, result_inst_9); SCHEDULING_CHECK_INIT(17); result_inst_10 = SyncScheduleTable(sched_explicit_next, 1); SCHEDULING_CHECK_AND_EQUAL_INT(18,E_OS_STATE, result_inst_10); SCHEDULING_CHECK_INIT(19); result_inst_11 = SyncScheduleTable(sched_explicit, 11); SCHEDULING_CHECK_AND_EQUAL_INT(20,E_OS_VALUE, result_inst_11); SCHEDULING_CHECK_INIT(21); result_inst_12 = SetScheduleTableAsync(INVALID_SCHEDULETABLE); SCHEDULING_CHECK_AND_EQUAL_INT(22,E_OS_ID, result_inst_12); SCHEDULING_CHECK_INIT(23); result_inst_13 = SetScheduleTableAsync(sched_implicit); SCHEDULING_CHECK_AND_EQUAL_INT(24,E_OS_ID, result_inst_13); SCHEDULING_CHECK_INIT(25); result_inst_14 = SetScheduleTableAsync(sched_nosync); SCHEDULING_CHECK_AND_EQUAL_INT(26,E_OS_ID, result_inst_14); SCHEDULING_CHECK_INIT(27); result_inst_15 = StartScheduleTableRel(sched_implicit, 1); SCHEDULING_CHECK_AND_EQUAL_INT(28,E_OS_ID, result_inst_15); }
/*test case:test the reaction of the system called with an activation of a isr*/ static void test_isr1_instance(void) { StatusType result_inst_1, result_inst_2, result_inst_3, result_inst_4, result_inst_5, result_inst_6, result_inst_7, result_inst_8, result_inst_9, result_inst_10, result_inst_11, result_inst_12; SCHEDULING_CHECK_INIT(2); result_inst_1 = GetResource(INVALID_RESOURCE); SCHEDULING_CHECK_AND_EQUAL_INT(2 , E_OS_ID, result_inst_1); SCHEDULING_CHECK_INIT(3); result_inst_2 = GetResource(Resource3); SCHEDULING_CHECK_AND_EQUAL_INT(3, E_OS_ACCESS, result_inst_2); SCHEDULING_CHECK_INIT(4); result_inst_3 = GetResource(Resource1); SCHEDULING_CHECK_AND_EQUAL_INT(4 , E_OK, result_inst_3); SCHEDULING_CHECK_INIT(5); result_inst_4 = GetResource(Resource1); SCHEDULING_CHECK_AND_EQUAL_INT(5 , E_OS_ACCESS, result_inst_4); SCHEDULING_CHECK_INIT(6); result_inst_5 = GetResource(RES_SCHEDULER); SCHEDULING_CHECK_AND_EQUAL_INT(6 , E_OS_ACCESS, result_inst_5); SCHEDULING_CHECK_INIT(7); result_inst_6 = GetResource(Resource2); SCHEDULING_CHECK_AND_EQUAL_INT(7 , E_OK, result_inst_6); tpl_send_it2(); tpl_send_it3(); /*it3 trigged*/ SCHEDULING_CHECK_INIT(9); result_inst_7 = ReleaseResource(Resource1); SCHEDULING_CHECK_AND_EQUAL_INT(9 , E_OS_NOFUNC, result_inst_7); SCHEDULING_CHECK_INIT(10); result_inst_8 = ReleaseResource(Resource2); SCHEDULING_CHECK_AND_EQUAL_INT(10 , E_OK, result_inst_8); SCHEDULING_CHECK_INIT(11); result_inst_9 = ReleaseResource(Resource1); /*it2 trigged*/ SCHEDULING_CHECK_AND_EQUAL_INT(12 , E_OK, result_inst_9); SCHEDULING_CHECK_INIT(13); result_inst_10 = ReleaseResource(INVALID_RESOURCE); SCHEDULING_CHECK_AND_EQUAL_INT(13 , E_OS_ID, result_inst_10); SCHEDULING_CHECK_INIT(14); result_inst_11 = ReleaseResource(Resource1); SCHEDULING_CHECK_AND_EQUAL_INT(14 , E_OS_NOFUNC, result_inst_11); SCHEDULING_CHECK_INIT(15); result_inst_12 = ReleaseResource(RES_SCHEDULER); SCHEDULING_CHECK_AND_EQUAL_INT(15 , E_OS_ACCESS, result_inst_12); }
/*test case:test the reaction of the system called with an activation of a task*/ static void test_t1_instance(void) { ApplicationType ApplicationType_inst_1, ApplicationType_inst_2; ISRType ISRType_inst_1; ObjectAccessType ObjectAccessType_inst_1; ScheduleTableStatusType ScheduleTableStatusType_inst_1; StatusType result_inst_1, result_inst_2, result_inst_3, result_inst_4, result_inst_5, result_inst_6, result_inst_7, result_inst_8, result_inst_9, result_inst_10, result_inst_11, result_inst_12; TickType TickType_inst_1, TickType_inst_2; SCHEDULING_CHECK_STEP(1); DisableAllInterrupts(); SCHEDULING_CHECK_INIT(2); ApplicationType_inst_1 = GetApplicationID(); SCHEDULING_CHECK_AND_EQUAL_INT(3, app1, ApplicationType_inst_1); SCHEDULING_CHECK_INIT(4); ISRType_inst_1 = GetISRID(); SCHEDULING_CHECK_AND_EQUAL_INT(5, INVALID_ISR, ISRType_inst_1); SCHEDULING_CHECK_INIT(6); ObjectAccessType_inst_1 = CheckObjectAccess(app1, OBJECT_TASK, t1); SCHEDULING_CHECK_AND_EQUAL_INT(7, ACCESS, ObjectAccessType_inst_1); SCHEDULING_CHECK_INIT(8); ApplicationType_inst_2 = CheckObjectOwnership(OBJECT_TASK, t1); SCHEDULING_CHECK_AND_EQUAL_INT(9, app1, ApplicationType_inst_2); SCHEDULING_CHECK_INIT(10); result_inst_1 = StartScheduleTableRel(sched1, 1); SCHEDULING_CHECK_AND_EQUAL_INT(11, E_OS_DISABLEDINT, result_inst_1); SCHEDULING_CHECK_INIT(12); result_inst_2 = StartScheduleTableAbs(sched1, 0); SCHEDULING_CHECK_AND_EQUAL_INT(13, E_OS_DISABLEDINT, result_inst_2); SCHEDULING_CHECK_INIT(14); result_inst_3 = StopScheduleTable(sched1); SCHEDULING_CHECK_AND_EQUAL_INT(15, E_OS_DISABLEDINT, result_inst_3); SCHEDULING_CHECK_INIT(16); result_inst_4 = NextScheduleTable(sched1, sched2); SCHEDULING_CHECK_AND_EQUAL_INT(17, E_OS_DISABLEDINT, result_inst_4); SCHEDULING_CHECK_INIT(18); result_inst_5 = StartScheduleTableSynchron(sched1); SCHEDULING_CHECK_AND_EQUAL_INT(19, E_OS_DISABLEDINT, result_inst_5); SCHEDULING_CHECK_INIT(20); result_inst_6 = SyncScheduleTable(sched1, 0); SCHEDULING_CHECK_AND_EQUAL_INT(21, E_OS_DISABLEDINT, result_inst_6); SCHEDULING_CHECK_INIT(22); result_inst_7 = GetScheduleTableStatus(sched1, &ScheduleTableStatusType_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT(23, E_OS_DISABLEDINT, result_inst_7); SCHEDULING_CHECK_INIT(24); result_inst_8 = SetScheduleTableAsync(sched1); SCHEDULING_CHECK_AND_EQUAL_INT(25, E_OS_DISABLEDINT, result_inst_8); SCHEDULING_CHECK_INIT(26); result_inst_9 = IncrementCounter(Software_Counter1); SCHEDULING_CHECK_AND_EQUAL_INT(27, E_OS_DISABLEDINT, result_inst_9); SCHEDULING_CHECK_INIT(28); result_inst_10 = GetCounterValue(Software_Counter1, &TickType_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT(29, E_OS_DISABLEDINT, result_inst_10); SCHEDULING_CHECK_INIT(30); result_inst_11 = GetElapsedCounterValue(Software_Counter1, &TickType_inst_1, &TickType_inst_2); SCHEDULING_CHECK_AND_EQUAL_INT(31, E_OS_DISABLEDINT, result_inst_11); SCHEDULING_CHECK_INIT(32); result_inst_12 = TerminateApplication(app1, NO_RESTART); SCHEDULING_CHECK_AND_EQUAL_INT(33, E_OS_DISABLEDINT, result_inst_12); SCHEDULING_CHECK_STEP(34); EnableAllInterrupts(); /* Missing : - CallTrustedFunction - CheckISRMemoryAccess - CheckTaskMemoryAccess - GetActiveApplicationMode (OS tests) Ok but not tested : - StartOS (OS tests) - ShutdownOS (OS tests) */ }
/*test case:test the reaction of the system called with an activation of a task*/ static void test_t1_instance(void) { StatusType result_inst_1, result_inst_1_5, result_inst_2, result_inst_3, result_inst_4, result_inst_5, result_inst_6, result_inst_7, result_inst_8, result_inst_9, result_inst_10, result_inst_11, result_inst_12, result_inst_13, result_inst_14, result_inst_15, result_inst_16, result_inst_17, result_inst_18, result_inst_19, result_inst_20; SCHEDULING_CHECK_INIT(1); result_inst_1 = GetResource(ResourceA); SCHEDULING_CHECK_AND_EQUAL_INT(1 , E_OK, result_inst_1); SCHEDULING_CHECK_INIT(2); result_inst_1_5 = ReleaseResource(ResourceA); SCHEDULING_CHECK_AND_EQUAL_INT(2 , E_OK, result_inst_1_5); SCHEDULING_CHECK_INIT(3); result_inst_2 = GetResource(INVALID_RESOURCE); SCHEDULING_CHECK_AND_EQUAL_INT(3 , E_OS_ID, result_inst_2); SCHEDULING_CHECK_INIT(4); result_inst_3 = GetResource(source1); SCHEDULING_CHECK_AND_EQUAL_INT(4 , E_OK, result_inst_3); SCHEDULING_CHECK_INIT(5); result_inst_4 = GetResource(Resource2); SCHEDULING_CHECK_AND_EQUAL_INT(5 , E_OK, result_inst_4); SCHEDULING_CHECK_INIT(6); result_inst_5 = GetResource(Resource3); SCHEDULING_CHECK_AND_EQUAL_INT(6 , E_OK, result_inst_5); SCHEDULING_CHECK_INIT(7); result_inst_6 = GetResource(Resource4); SCHEDULING_CHECK_AND_EQUAL_INT(7 , E_OK, result_inst_6); SCHEDULING_CHECK_INIT(8); result_inst_7 = GetResource(Resource5); SCHEDULING_CHECK_AND_EQUAL_INT(8 , E_OK, result_inst_7); SCHEDULING_CHECK_INIT(9); result_inst_8 = GetResource(Resource6); SCHEDULING_CHECK_AND_EQUAL_INT(9 , E_OK, result_inst_8); SCHEDULING_CHECK_INIT(10); result_inst_9 = ReleaseResource(Resource6); SCHEDULING_CHECK_AND_EQUAL_INT(10 , E_OK, result_inst_9); SCHEDULING_CHECK_INIT(11); result_inst_10 = ReleaseResource(Resource5); SCHEDULING_CHECK_AND_EQUAL_INT(11 , E_OK, result_inst_10); SCHEDULING_CHECK_INIT(12); result_inst_11 = ReleaseResource(Resource4); SCHEDULING_CHECK_AND_EQUAL_INT(12 , E_OK, result_inst_11); SCHEDULING_CHECK_INIT(13); result_inst_12 = ReleaseResource(Resource3); SCHEDULING_CHECK_AND_EQUAL_INT(13 , E_OK, result_inst_12); SCHEDULING_CHECK_INIT(14); result_inst_13 = ReleaseResource(source1); SCHEDULING_CHECK_AND_EQUAL_INT(14 , E_OS_NOFUNC, result_inst_13); SCHEDULING_CHECK_INIT(15); result_inst_14 = ReleaseResource(Resource2); SCHEDULING_CHECK_AND_EQUAL_INT(15 , E_OK, result_inst_14); SCHEDULING_CHECK_INIT(16); result_inst_15 = GetResource(source1); SCHEDULING_CHECK_AND_EQUAL_INT(16 , E_OS_ACCESS, result_inst_15); SCHEDULING_CHECK_INIT(17); result_inst_17 = ReleaseResource(source1); SCHEDULING_CHECK_AND_EQUAL_INT(17 , E_OK, result_inst_17); SCHEDULING_CHECK_INIT(18); result_inst_16 = ActivateTask(t2); /*force scheduling*/ SCHEDULING_CHECK_AND_EQUAL_INT(21 , E_OK, result_inst_16); SCHEDULING_CHECK_INIT(22); result_inst_18 = ReleaseResource(INVALID_RESOURCE); SCHEDULING_CHECK_AND_EQUAL_INT(22 , E_OS_ID, result_inst_18); SCHEDULING_CHECK_INIT(23); result_inst_19 = ReleaseResource(source1); SCHEDULING_CHECK_AND_EQUAL_INT(23 , E_OS_NOFUNC, result_inst_19); SCHEDULING_CHECK_INIT(24); result_inst_20 = ReleaseResource(RES_SCHEDULER); SCHEDULING_CHECK_AND_EQUAL_INT(24 , E_OS_NOFUNC, result_inst_20); }
/*test case:test the reaction of the system called with an activation of a task*/ static void test_t1_instance(void) { StatusType result_inst_1, result_inst_2, result_inst_3, result_inst_4, result_inst_5, result_inst_6, result_inst_7, result_inst_8, result_inst_9, result_inst_10, result_inst_11; StatusType result_inst_12, result_inst_13, result_inst_14, result_inst_15, result_inst_16, result_inst_17, result_inst_18, result_inst_19, result_inst_20, result_inst_21, result_inst_22, result_inst_23, result_inst_24; ScheduleTableStatusType ScheduleTableStatusType_inst_1, ScheduleTableStatusType_inst_2, ScheduleTableStatusType_inst_3, ScheduleTableStatusType_inst_4, ScheduleTableStatusType_inst_5, ScheduleTableStatusType_inst_6; SCHEDULING_CHECK_INIT(1); result_inst_1 = StartScheduleTableAbs(sched1, 1); SCHEDULING_CHECK_AND_EQUAL_INT(1,E_OK, result_inst_1); SCHEDULING_CHECK_INIT(2); result_inst_2 = StartScheduleTableAbs(sched2, 1); SCHEDULING_CHECK_AND_EQUAL_INT(2,E_OK, result_inst_2); SCHEDULING_CHECK_INIT(3); result_inst_3 = GetScheduleTableStatus(sched1, &ScheduleTableStatusType_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(3, SCHEDULETABLE_RUNNING_AND_SYNCHRONOUS , ScheduleTableStatusType_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT(3,E_OK, result_inst_3); SCHEDULING_CHECK_INIT(4); result_inst_4 = GetScheduleTableStatus(sched2, &ScheduleTableStatusType_inst_2); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(4, SCHEDULETABLE_RUNNING_AND_SYNCHRONOUS , ScheduleTableStatusType_inst_2); SCHEDULING_CHECK_AND_EQUAL_INT(4,E_OK, result_inst_4); SCHEDULING_CHECK_INIT(5); result_inst_5 = IncrementCounter(Software_Counter1); /*offset = 1 -> sched1 starts */ SCHEDULING_CHECK_AND_EQUAL_INT(5,E_OK, result_inst_5); SCHEDULING_CHECK_INIT(6); result_inst_6 = IncrementCounter(Software_Counter2); /*offset = 1 -> sched2 starts and event1 can't be set -> errorhook*/ SCHEDULING_CHECK_AND_EQUAL_INT(7,E_OK, result_inst_6); SCHEDULING_CHECK_INIT(8); result_inst_7 = IncrementCounter(Software_Counter1); /*offset = 2 -> t2 starts */ SCHEDULING_CHECK_AND_EQUAL_INT(9,E_OK, result_inst_7); SCHEDULING_CHECK_INIT(10); result_inst_8 = IncrementCounter(Software_Counter2); /*offset = 2 */ SCHEDULING_CHECK_AND_EQUAL_INT(10,E_OK, result_inst_8); SCHEDULING_CHECK_INIT(11); result_inst_9 = IncrementCounter(Software_Counter1); /*offset = 3 */ SCHEDULING_CHECK_AND_EQUAL_INT(11,E_OK, result_inst_9); SCHEDULING_CHECK_INIT(12); result_inst_10 = IncrementCounter(Software_Counter2); /*offset = 3 -> */ SCHEDULING_CHECK_AND_EQUAL_INT(12,E_OK, result_inst_10); SCHEDULING_CHECK_INIT(13); result_inst_11 = IncrementCounter(Software_Counter1); /*offset = 4 -> sched2 restarts */ SCHEDULING_CHECK_AND_EQUAL_INT(13,E_OK, result_inst_11); SCHEDULING_CHECK_INIT(14); result_inst_12 = IncrementCounter(Software_Counter2); /*offset = 4 -> */ SCHEDULING_CHECK_AND_EQUAL_INT(14,E_OK, result_inst_12); SCHEDULING_CHECK_INIT(15); result_inst_13 = IncrementCounter(Software_Counter1); /*offset = 5 -> t2 can't start -> errorhook */ SCHEDULING_CHECK_AND_EQUAL_INT(16,E_OK, result_inst_13); SCHEDULING_CHECK_INIT(17); result_inst_14 = IncrementCounter(Software_Counter2); /*offset = 5 */ SCHEDULING_CHECK_AND_EQUAL_INT(17,E_OK, result_inst_14); SCHEDULING_CHECK_INIT(18); result_inst_15 = IncrementCounter(Software_Counter1); /*offset = 6 */ SCHEDULING_CHECK_AND_EQUAL_INT(18,E_OK, result_inst_15); SCHEDULING_CHECK_INIT(19); result_inst_16 = IncrementCounter(Software_Counter2); /*offset = 6 -> t2 received event1 */ SCHEDULING_CHECK_AND_EQUAL_INT(20,E_OK, result_inst_16); SCHEDULING_CHECK_INIT(21); result_inst_17 = IncrementCounter(Software_Counter1); /*offset = 7 */ SCHEDULING_CHECK_AND_EQUAL_INT(21,E_OK, result_inst_17); SCHEDULING_CHECK_INIT(22); result_inst_18 = IncrementCounter(Software_Counter2); /*offset = 7 -> t2 can't received event1 -> errorhook */ SCHEDULING_CHECK_AND_EQUAL_INT(23,E_OK, result_inst_18); SCHEDULING_CHECK_INIT(24); result_inst_19 = GetScheduleTableStatus(sched1, &ScheduleTableStatusType_inst_3); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(24, SCHEDULETABLE_RUNNING_AND_SYNCHRONOUS , ScheduleTableStatusType_inst_3); SCHEDULING_CHECK_AND_EQUAL_INT(24,E_OK, result_inst_19); SCHEDULING_CHECK_INIT(25); result_inst_20 = GetScheduleTableStatus(sched2, &ScheduleTableStatusType_inst_4); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(25, SCHEDULETABLE_RUNNING_AND_SYNCHRONOUS , ScheduleTableStatusType_inst_4); SCHEDULING_CHECK_AND_EQUAL_INT(25,E_OK, result_inst_20); SCHEDULING_CHECK_INIT(26); result_inst_21 = StopScheduleTable(sched1); SCHEDULING_CHECK_AND_EQUAL_INT(26,E_OK, result_inst_21); SCHEDULING_CHECK_INIT(27); result_inst_22 = StopScheduleTable(sched2); SCHEDULING_CHECK_AND_EQUAL_INT(27,E_OK, result_inst_22); SCHEDULING_CHECK_INIT(28); result_inst_23 = GetScheduleTableStatus(sched1, &ScheduleTableStatusType_inst_5); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(28, SCHEDULETABLE_STOPPED , ScheduleTableStatusType_inst_5); SCHEDULING_CHECK_AND_EQUAL_INT(28,E_OK, result_inst_23); SCHEDULING_CHECK_INIT(29); result_inst_24 = GetScheduleTableStatus(sched2, &ScheduleTableStatusType_inst_6); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(29, SCHEDULETABLE_STOPPED , ScheduleTableStatusType_inst_6); SCHEDULING_CHECK_AND_EQUAL_INT(29,E_OK, result_inst_24); }
/*test case:test the reaction of the system called with an activation of a task*/ static void test_t1_instance(void) { StatusType result_inst_1, result_inst_2, result_inst_3, result_inst_4, result_inst_5, result_inst_6, result_inst_7, result_inst_8, result_inst_9, result_inst_10; StatusType result_inst_11, result_inst_12, result_inst_13, result_inst_14, result_inst_15, result_inst_16, result_inst_17, result_inst_18, result_inst_19, result_inst_20; StatusType result_inst_21, result_inst_22, result_inst_23, result_inst_24, result_inst_25, result_inst_26, result_inst_27, result_inst_28, result_inst_29, result_inst_30; StatusType result_inst_31, result_inst_32, result_inst_33, result_inst_34, result_inst_35, result_inst_36, result_inst_37, result_inst_38, result_inst_39; ScheduleTableStatusType ScheduleTableStatusType_inst_1, ScheduleTableStatusType_inst_2, ScheduleTableStatusType_inst_3, ScheduleTableStatusType_inst_4, ScheduleTableStatusType_inst_5; ScheduleTableStatusType ScheduleTableStatusType_inst_6, ScheduleTableStatusType_inst_7, ScheduleTableStatusType_inst_8, ScheduleTableStatusType_inst_9, ScheduleTableStatusType_inst_10, ScheduleTableStatusType_inst_11; SCHEDULING_CHECK_INIT(1); result_inst_1 = StartScheduleTableSynchron(sched_explicit); SCHEDULING_CHECK_AND_EQUAL_INT(1,E_OK, result_inst_1); SCHEDULING_CHECK_INIT(2); result_inst_2 = GetScheduleTableStatus(sched_explicit, &ScheduleTableStatusType_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(2, SCHEDULETABLE_WAITING , ScheduleTableStatusType_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT(2,E_OK, result_inst_2); SCHEDULING_CHECK_INIT(3); result_inst_3 = SyncScheduleTable(sched_explicit, 8); SCHEDULING_CHECK_AND_EQUAL_INT(3,E_OK, result_inst_3); SCHEDULING_CHECK_INIT(4); result_inst_4 = GetScheduleTableStatus(sched_explicit, &ScheduleTableStatusType_inst_2); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(4, SCHEDULETABLE_RUNNING_AND_SYNCHRONOUS , ScheduleTableStatusType_inst_2); SCHEDULING_CHECK_AND_EQUAL_INT(4,E_OK, result_inst_4); SCHEDULING_CHECK_INIT(5); result_inst_5 = IncrementCounter(Software_Counter1); /*offset = 1 (sc) - 9 (st) */ SCHEDULING_CHECK_AND_EQUAL_INT(5,E_OK, result_inst_5); SCHEDULING_CHECK_INIT(6); result_inst_6 = IncrementCounter(Software_Counter1); /*offset = 2 (sc) - 0 (st) */ SCHEDULING_CHECK_AND_EQUAL_INT(6,E_OK, result_inst_6); SCHEDULING_CHECK_INIT(7); result_inst_7 = GetScheduleTableStatus(sched_explicit, &ScheduleTableStatusType_inst_3); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(7, SCHEDULETABLE_RUNNING_AND_SYNCHRONOUS , ScheduleTableStatusType_inst_3); SCHEDULING_CHECK_AND_EQUAL_INT(7,E_OK, result_inst_7); SCHEDULING_CHECK_INIT(8); result_inst_8 = SetScheduleTableAsync(sched_explicit); SCHEDULING_CHECK_AND_EQUAL_INT(8,E_OK, result_inst_8); SCHEDULING_CHECK_INIT(9); result_inst_9 = GetScheduleTableStatus(sched_explicit, &ScheduleTableStatusType_inst_4); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(9, SCHEDULETABLE_RUNNING , ScheduleTableStatusType_inst_4); SCHEDULING_CHECK_AND_EQUAL_INT(9,E_OK, result_inst_9); SCHEDULING_CHECK_INIT(10); result_inst_10 = IncrementCounter(Software_Counter1); /*offset = 3 (sc) - 1 (st) */ SCHEDULING_CHECK_AND_EQUAL_INT(10,E_OK, result_inst_10); SCHEDULING_CHECK_INIT(11); result_inst_11 = IncrementCounter(Software_Counter1); /*offset = 4 (sc) - 2 (st) -> t2 activated */ SCHEDULING_CHECK_AND_EQUAL_INT(12,E_OK, result_inst_11); SCHEDULING_CHECK_INIT(13); result_inst_12 = GetScheduleTableStatus(sched_explicit, &ScheduleTableStatusType_inst_5); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(13, SCHEDULETABLE_RUNNING , ScheduleTableStatusType_inst_5); SCHEDULING_CHECK_AND_EQUAL_INT(13,E_OK, result_inst_12); SCHEDULING_CHECK_INIT(14); result_inst_13 = IncrementCounter(Software_Counter1); /*offset = 5 (sc) - 3 (st) */ SCHEDULING_CHECK_AND_EQUAL_INT(14,E_OK, result_inst_13); SCHEDULING_CHECK_INIT(15); result_inst_14 = IncrementCounter(Software_Counter1); /*offset = 6 (sc) - 4 (st) */ SCHEDULING_CHECK_AND_EQUAL_INT(15,E_OK, result_inst_14); SCHEDULING_CHECK_INIT(16); result_inst_15 = IncrementCounter(Software_Counter1); /*offset = 7 (sc) - 5 (st) -> t2 received Event1 */ SCHEDULING_CHECK_AND_EQUAL_INT(18,E_OK, result_inst_15); SCHEDULING_CHECK_INIT(19); result_inst_16 = IncrementCounter(Software_Counter1); /*offset = 8 (sc) - 6 (st) */ SCHEDULING_CHECK_AND_EQUAL_INT(19,E_OK, result_inst_16); SCHEDULING_CHECK_INIT(20); result_inst_17 = IncrementCounter(Software_Counter1); /*offset = 9 (sc) - 7 (st) */ SCHEDULING_CHECK_AND_EQUAL_INT(20,E_OK, result_inst_17); SCHEDULING_CHECK_INIT(21); result_inst_18 = IncrementCounter(Software_Counter1); /*offset = 10 (sc) - 8 (st) -> t2 received Event1 */ SCHEDULING_CHECK_AND_EQUAL_INT(22,E_OK, result_inst_18); SCHEDULING_CHECK_INIT(23); result_inst_19 = GetScheduleTableStatus(sched_explicit, &ScheduleTableStatusType_inst_6); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(23, SCHEDULETABLE_RUNNING , ScheduleTableStatusType_inst_6); SCHEDULING_CHECK_AND_EQUAL_INT(23,E_OK, result_inst_19); SCHEDULING_CHECK_INIT(24); result_inst_20 = SyncScheduleTable(sched_explicit, 8); SCHEDULING_CHECK_AND_EQUAL_INT(24,E_OK, result_inst_20); SCHEDULING_CHECK_INIT(25); result_inst_21 = GetScheduleTableStatus(sched_explicit, &ScheduleTableStatusType_inst_7); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(25, SCHEDULETABLE_RUNNING_AND_SYNCHRONOUS , ScheduleTableStatusType_inst_7); SCHEDULING_CHECK_AND_EQUAL_INT(25,E_OK, result_inst_21); SCHEDULING_CHECK_INIT(26); result_inst_22 = IncrementCounter(Software_Counter1); /*offset = 11 (sc) - 9 (st) */ SCHEDULING_CHECK_AND_EQUAL_INT(26,E_OK, result_inst_22); SCHEDULING_CHECK_INIT(27); result_inst_23 = IncrementCounter(Software_Counter1); /*offset = 12 (sc) - 0 (st) */ SCHEDULING_CHECK_AND_EQUAL_INT(27,E_OK, result_inst_23); SCHEDULING_CHECK_INIT(28); result_inst_24 = IncrementCounter(Software_Counter1); /*offset = 13 (sc) - 1 (st) */ SCHEDULING_CHECK_AND_EQUAL_INT(28,E_OK, result_inst_24); SCHEDULING_CHECK_INIT(29); result_inst_25 = GetScheduleTableStatus(sched_explicit, &ScheduleTableStatusType_inst_8); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(29, SCHEDULETABLE_RUNNING_AND_SYNCHRONOUS , ScheduleTableStatusType_inst_8); SCHEDULING_CHECK_AND_EQUAL_INT(29,E_OK, result_inst_25); SCHEDULING_CHECK_INIT(30); result_inst_26 = SyncScheduleTable(sched_explicit, 4); SCHEDULING_CHECK_AND_EQUAL_INT(30,E_OK, result_inst_26); SCHEDULING_CHECK_INIT(31); result_inst_27 = GetScheduleTableStatus(sched_explicit, &ScheduleTableStatusType_inst_9); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(31, SCHEDULETABLE_RUNNING , ScheduleTableStatusType_inst_9); SCHEDULING_CHECK_AND_EQUAL_INT(31,E_OK, result_inst_27); SCHEDULING_CHECK_INIT(32); result_inst_28 = IncrementCounter(Software_Counter1); /*offset = 14 (sc) - 5 (st) -> t2 activated */ SCHEDULING_CHECK_AND_EQUAL_INT(33,E_OK, result_inst_28); SCHEDULING_CHECK_INIT(34); result_inst_29 = SetScheduleTableAsync(sched_explicit); SCHEDULING_CHECK_AND_EQUAL_INT(34,E_OK, result_inst_29); SCHEDULING_CHECK_INIT(35); result_inst_30 = GetScheduleTableStatus(sched_explicit, &ScheduleTableStatusType_inst_10); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(35, SCHEDULETABLE_RUNNING , ScheduleTableStatusType_inst_10); SCHEDULING_CHECK_AND_EQUAL_INT(35,E_OK, result_inst_30); SCHEDULING_CHECK_INIT(36); result_inst_31 = IncrementCounter(Software_Counter1); /*offset = 15 (sc) - 6->5 (st) -> t2 receive Event1 */ SCHEDULING_CHECK_AND_EQUAL_INT(38,E_OK, result_inst_31); SCHEDULING_CHECK_INIT(39); result_inst_32 = IncrementCounter(Software_Counter1); /*offset = 16 (sc) - 6 (st) */ SCHEDULING_CHECK_AND_EQUAL_INT(39,E_OK, result_inst_32); SCHEDULING_CHECK_INIT(40); result_inst_33 = IncrementCounter(Software_Counter1); /*offset = 17 (sc) - 7 (st) */ SCHEDULING_CHECK_AND_EQUAL_INT(40,E_OK, result_inst_33); SCHEDULING_CHECK_INIT(41); result_inst_34 = IncrementCounter(Software_Counter1); /*offset = 18 (sc) - 8 (st) -> t2 received Event1 */ SCHEDULING_CHECK_AND_EQUAL_INT(42,E_OK, result_inst_34); SCHEDULING_CHECK_INIT(43); result_inst_35 = IncrementCounter(Software_Counter1); /*offset = 19 (sc) - 9 (st) */ SCHEDULING_CHECK_AND_EQUAL_INT(43,E_OK, result_inst_35); SCHEDULING_CHECK_INIT(44); result_inst_36 = IncrementCounter(Software_Counter1); /*offset = 20 (sc) - 0 (st) */ SCHEDULING_CHECK_AND_EQUAL_INT(44,E_OK, result_inst_36); SCHEDULING_CHECK_INIT(45); result_inst_37 = IncrementCounter(Software_Counter1); /*offset = 21 (sc) - 1 (st) */ SCHEDULING_CHECK_AND_EQUAL_INT(45,E_OK, result_inst_37); SCHEDULING_CHECK_INIT(46); result_inst_38 = IncrementCounter(Software_Counter1); /*offset = 22 (sc) - 2 (st) -> t2 activated */ SCHEDULING_CHECK_AND_EQUAL_INT(47,E_OK, result_inst_38); SCHEDULING_CHECK_INIT(48); result_inst_39 = GetScheduleTableStatus(sched_explicit, &ScheduleTableStatusType_inst_11); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(48, SCHEDULETABLE_RUNNING , ScheduleTableStatusType_inst_11); SCHEDULING_CHECK_AND_EQUAL_INT(48,E_OK, result_inst_39); }
/*test case:test the reaction of the system called with an activation of a task*/ static void test_t1_instance(void) { StatusType result_inst_1, result_inst_2, result_inst_3, result_inst_4, result_inst_5, result_inst_6, result_inst_7, result_inst_8, result_inst_9, result_inst_10, result_inst_11, result_inst_12, result_inst_13, result_inst_14, result_inst_15, result_inst_16, result_inst_17, result_inst_18, result_inst_19, result_inst_20, result_inst_21, result_inst_22, result_inst_23, result_inst_24; SCHEDULING_CHECK_INIT(1); result_inst_1 = ActivateTask(t2); SCHEDULING_CHECK_AND_EQUAL_INT(1,E_OK , result_inst_1); SCHEDULING_CHECK_INIT(2); result_inst_2 = ActivateTask(t3); SCHEDULING_CHECK_AND_EQUAL_INT(2,E_OK , result_inst_2); SCHEDULING_CHECK_INIT(3); result_inst_3 = ActivateTask(t4); SCHEDULING_CHECK_AND_EQUAL_INT(3,E_OK , result_inst_3); SCHEDULING_CHECK_INIT(4); result_inst_4 = ActivateTask(t5); SCHEDULING_CHECK_AND_EQUAL_INT(4,E_OK , result_inst_4); SCHEDULING_CHECK_INIT(5); result_inst_5 = ActivateTask(t6); SCHEDULING_CHECK_AND_EQUAL_INT(5,E_OK , result_inst_5); SCHEDULING_CHECK_INIT(6); result_inst_6 = ActivateTask(t7); SCHEDULING_CHECK_AND_EQUAL_INT(6,E_OK , result_inst_6); SCHEDULING_CHECK_INIT(7); result_inst_7 = ActivateTask(t8); SCHEDULING_CHECK_AND_EQUAL_INT(7,E_OK , result_inst_7); SCHEDULING_CHECK_INIT(8); result_inst_8 = ActivateTask(t9); SCHEDULING_CHECK_AND_EQUAL_INT(8,E_OK , result_inst_8); SCHEDULING_CHECK_INIT(9); result_inst_9 = ActivateTask(t10); SCHEDULING_CHECK_AND_EQUAL_INT(9,E_OK , result_inst_9); SCHEDULING_CHECK_INIT(10); result_inst_10 = ActivateTask(t11); SCHEDULING_CHECK_AND_EQUAL_INT(10,E_OK , result_inst_10); SCHEDULING_CHECK_INIT(11); result_inst_11 = ActivateTask(t12); SCHEDULING_CHECK_AND_EQUAL_INT(11,E_OK , result_inst_11); SCHEDULING_CHECK_INIT(12); result_inst_12 = ActivateTask(t13); SCHEDULING_CHECK_AND_EQUAL_INT(12,E_OK , result_inst_12); SCHEDULING_CHECK_INIT(13); result_inst_13 = ActivateTask(t14); SCHEDULING_CHECK_AND_EQUAL_INT(13,E_OK , result_inst_13); SCHEDULING_CHECK_INIT(14); result_inst_14 = ActivateTask(t15); SCHEDULING_CHECK_AND_EQUAL_INT(14,E_OK , result_inst_14); SCHEDULING_CHECK_INIT(15); result_inst_15 = ActivateTask(t16); SCHEDULING_CHECK_AND_EQUAL_INT(15,E_OK , result_inst_15); SCHEDULING_CHECK_INIT(16); result_inst_16 = ClearEvent(Task1_Event1); SCHEDULING_CHECK_AND_EQUAL_INT(16,E_OK , result_inst_16); SCHEDULING_CHECK_INIT(17); result_inst_17 = ClearEvent(Task1_Event2); SCHEDULING_CHECK_AND_EQUAL_INT(17,E_OK , result_inst_17); SCHEDULING_CHECK_INIT(18); result_inst_18 = ClearEvent(Task1_Event3); SCHEDULING_CHECK_AND_EQUAL_INT(18,E_OK , result_inst_18); SCHEDULING_CHECK_INIT(19); result_inst_19 = ClearEvent(Task1_Event4); SCHEDULING_CHECK_AND_EQUAL_INT(19,E_OK , result_inst_19); SCHEDULING_CHECK_INIT(20); result_inst_20 = ClearEvent(Task1_Event5); SCHEDULING_CHECK_AND_EQUAL_INT(20,E_OK , result_inst_20); SCHEDULING_CHECK_INIT(21); result_inst_21 = ClearEvent(Task1_Event6); SCHEDULING_CHECK_AND_EQUAL_INT(21,E_OK , result_inst_21); SCHEDULING_CHECK_INIT(22); result_inst_22 = ClearEvent(Task1_Event7); SCHEDULING_CHECK_AND_EQUAL_INT(22,E_OK , result_inst_22); SCHEDULING_CHECK_INIT(23); result_inst_23 = ClearEvent(Task1_Event8); SCHEDULING_CHECK_AND_EQUAL_INT(23,E_OK , result_inst_23); SCHEDULING_CHECK_INIT(24); result_inst_24 = TerminateTask(); SCHEDULING_CHECK_AND_EQUAL_INT(24,E_OK , result_inst_24); }