コード例 #1
0
/*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, result_inst_10, result_inst_11;
	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(4,E_OK, result_inst_5);
	
	SCHEDULING_CHECK_INIT(5);
	result_inst_6 = Schedule();
	SCHEDULING_CHECK_AND_EQUAL_INT(9,E_OK, result_inst_6);
	
	SCHEDULING_CHECK_INIT(10);
	result_inst_7 = GetResource(RES_SCHEDULER);
	SCHEDULING_CHECK_AND_EQUAL_INT(10,E_OK, result_inst_7);
	
	SCHEDULING_CHECK_INIT(11);
	result_inst_8 = TerminateTask();
	SCHEDULING_CHECK_AND_EQUAL_INT(11,E_OS_RESOURCE, result_inst_8);
	
	SCHEDULING_CHECK_INIT(12);
	result_inst_9 = ChainTask(t2);
	SCHEDULING_CHECK_AND_EQUAL_INT(12,E_OS_RESOURCE, result_inst_9);
	
	SCHEDULING_CHECK_INIT(13);
	result_inst_10 = Schedule();
	SCHEDULING_CHECK_AND_EQUAL_INT(13,E_OS_RESOURCE, result_inst_10);
	
	SCHEDULING_CHECK_INIT(14);
	result_inst_11 = ReleaseResource(RES_SCHEDULER);
	SCHEDULING_CHECK_AND_EQUAL_INT(14,E_OK, result_inst_11);
	
	sendSoftwareIt(0, SOFT_IRQ0);
	
	SCHEDULING_CHECK_STEP(19);
}
コード例 #2
0
/*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_4,result_inst_5,result_inst_6,result_inst_7;
	TaskStateType result_inst_3;
	
	SCHEDULING_CHECK_INIT(1);
	result_inst_1 = ActivateTask(t2);
	SCHEDULING_CHECK_AND_EQUAL_INT(4 , E_OK , result_inst_1);
	
	SCHEDULING_CHECK_INIT(5);
	result_inst_4 = GetTaskState(t2,&result_inst_3);
	SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(5 , WAITING , result_inst_3);
	SCHEDULING_CHECK_AND_EQUAL_INT(5 , E_OK , result_inst_4);
	
	SCHEDULING_CHECK_INIT(6);
	result_inst_5 = ActivateTask(t2);
	SCHEDULING_CHECK_AND_EQUAL_INT(6 , E_OS_LIMIT , result_inst_5);
	
	SCHEDULING_CHECK_INIT(7);
	result_inst_6 = ChainTask(t2);
	SCHEDULING_CHECK_AND_EQUAL_INT(7 , E_OS_LIMIT , result_inst_6);	
	
	SCHEDULING_CHECK_INIT(8);
	result_inst_7 = SetEvent(t2,Event2);
	SCHEDULING_CHECK_AND_EQUAL_INT(10 , E_OK , result_inst_7);

}
コード例 #3
0
ファイル: task2_instance.c プロジェクト: 1984c/trampoline
/*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;
	
	SCHEDULING_CHECK_INIT(2);
	result_inst_1 = ActivateTask(t1);
	SCHEDULING_CHECK_AND_EQUAL_INT(2 , E_OS_LIMIT , result_inst_1); 
	
	SCHEDULING_CHECK_INIT(3);
	result_inst_2 = ActivateTask(t2);
	SCHEDULING_CHECK_AND_EQUAL_INT(3 , E_OS_LIMIT , result_inst_2);
	
	SCHEDULING_CHECK_INIT(4);
	result_inst_3 = WaitEvent(Event2);
	SCHEDULING_CHECK_AND_EQUAL_INT(8 , E_OK , result_inst_3);
	
	SCHEDULING_CHECK_INIT(9);
	result_inst_4 = ChainTask(t1);
	SCHEDULING_CHECK_AND_EQUAL_INT(9 , E_OS_LIMIT , result_inst_4);
	
	SCHEDULING_CHECK_INIT(10);
	result_inst_5 = TerminateTask();
	SCHEDULING_CHECK_AND_EQUAL_INT(10 , E_OK , result_inst_5);
	
}
コード例 #4
0
/*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_INIT(1);
	result_inst_1 = ChainTask(t2);
	SCHEDULING_CHECK_AND_EQUAL_INT(1,E_OK , result_inst_1);	
	
}
コード例 #5
0
ファイル: task3_instance1.c プロジェクト: 1984c/trampoline
/*test case:test the reaction of the system called with 
 an activation of a task*/
static void test_t3_instance1(void)
{
	StatusType result_inst;
	
	SCHEDULING_CHECK_INIT(8);
	result_inst = ChainTask(t3);
	SCHEDULING_CHECK_AND_EQUAL_INT(8,E_OK , result_inst);
	
}
コード例 #6
0
ファイル: task1_instance.c プロジェクト: 1984c/trampoline
/*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);
	
}
コード例 #7
0
ファイル: task1_instance.c プロジェクト: 1984c/trampoline
/*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;
	
	SCHEDULING_CHECK_INIT(1);
	result_inst_1 = ActivateTask(t1);
	SCHEDULING_CHECK_AND_EQUAL_INT(3,E_OS_LIMIT , result_inst_1);	
	
	SCHEDULING_CHECK_INIT(4);
	result_inst_2 = ChainTask(t1);
	SCHEDULING_CHECK_AND_EQUAL_INT(4,E_OK , result_inst_2);	
	
}
コード例 #8
0
/*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;
  int t1_instance = posttask_instance/2;
  int test_start = t1_instance * 4;
	
	SCHEDULING_CHECK_INIT(test_start + 1);
	result_inst_1 = ActivateTask(t1);
	SCHEDULING_CHECK_AND_EQUAL_INT(test_start + 3,E_OS_LIMIT , result_inst_1);	
	
	SCHEDULING_CHECK_INIT(test_start + 4);
	result_inst_2 = ChainTask(t1);
	SCHEDULING_CHECK_AND_EQUAL_INT(test_start + 4,E_OK , result_inst_2);	
	
}
コード例 #9
0
/*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;
	
	SCHEDULING_CHECK_INIT(5);
	result_inst_1 = ActivateTask(t1);
	SCHEDULING_CHECK_AND_EQUAL_INT(5,E_OS_LIMIT, result_inst_1);
	
	SCHEDULING_CHECK_INIT(6);
	result_inst_2 = ActivateTask(t2);
	SCHEDULING_CHECK_AND_EQUAL_INT(6,E_OS_LIMIT, result_inst_2);
	
	SCHEDULING_CHECK_INIT(7);
	result_inst_3 = ChainTask(t1);
	SCHEDULING_CHECK_AND_EQUAL_INT(7,E_OS_LIMIT, result_inst_3);
	
	SCHEDULING_CHECK_INIT(8);
	result_inst_4 = TerminateTask();
	SCHEDULING_CHECK_AND_EQUAL_INT(8,E_OK, result_inst_4);
}
コード例 #10
0
ファイル: task1_instance.c プロジェクト: 1984c/trampoline
/*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;
	
	SCHEDULING_CHECK_INIT(8);
	result_inst_1 = SetAbsAlarm(Alarm1, 16, 0);
	SCHEDULING_CHECK_AND_EQUAL_INT(8,E_OK , result_inst_1); 

	SCHEDULING_CHECK_INIT(9);
	result_inst_2 = WaitEvent(Event1);
	SCHEDULING_CHECK_AND_EQUAL_INT(30,E_OK , result_inst_2); 

	SCHEDULING_CHECK_INIT(31);
	result_inst_3 = SetEvent(t1, Event1);
	SCHEDULING_CHECK_AND_EQUAL_INT(31,E_OK , result_inst_3); 
	
	SCHEDULING_CHECK_INIT(32);
	result_inst_4 = ChainTask(t2);
	SCHEDULING_CHECK_AND_EQUAL_INT(32,E_OK , result_inst_4); 
	
}
コード例 #11
0
ファイル: isr1_instance.c プロジェクト: hl1itj/nds-ide
/*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_5;
	TaskType result_inst_4;
    
	SCHEDULING_CHECK_INIT(15);
	result_inst_1 = TerminateTask();
	SCHEDULING_CHECK_AND_EQUAL_INT(15,E_OS_CALLEVEL , result_inst_1);
	
	SCHEDULING_CHECK_INIT(16);
	result_inst_2 = ChainTask(t2);
	SCHEDULING_CHECK_AND_EQUAL_INT(16,E_OS_CALLEVEL , result_inst_2);
	
	SCHEDULING_CHECK_INIT(17);
	result_inst_3 = Schedule();
	SCHEDULING_CHECK_AND_EQUAL_INT(17,E_OS_CALLEVEL , result_inst_3);
	
	SCHEDULING_CHECK_INIT(18);
	result_inst_5 = GetTaskID(&result_inst_4);
	SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(18,INVALID_TASK , result_inst_4);
	SCHEDULING_CHECK_AND_EQUAL_INT(18,E_OK , result_inst_5);
	
}
コード例 #12
0
ファイル: task1_instance.c プロジェクト: 1984c/trampoline
/*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();
}