Exemplo n.º 1
0
/*test case:test the reaction of the system called with 
 an activation of a task*/
static void test_t1_instance(void)
{
	SCHEDULING_CHECK_STEP(1);
	
	tpl_send_it1();
	
	SCHEDULING_CHECK_STEP(16);
}
Exemplo n.º 2
0
/*test case:test the reaction of the system called with 
 an activation of a isr*/
static void test_isr3_instance(void)
{	
	SCHEDULING_CHECK_STEP(23);
	
	tpl_send_it2();
	
	SCHEDULING_CHECK_STEP(24);
	
}
Exemplo n.º 3
0
/*test case:test the reaction of the system called with 
 an activation of a task*/
static void test_t2_instance(void)
{
	
	SCHEDULING_CHECK_STEP(10);
	
	/*check interrupts enabled*/
	tpl_send_it1();
	
	SCHEDULING_CHECK_STEP(12);
	
}
/*test case:test the reaction of the system called with 
 an activation of a task*/
static void test_callback1_instance(void)
{	
	
	SCHEDULING_CHECK_STEP(2);
	
	SuspendAllInterrupts();
	ResumeAllInterrupts();
	sendSoftwareIt(0, SOFT_IRQ0);
	
	SCHEDULING_CHECK_STEP(3);
	
}
Exemplo n.º 5
0
/*test case:test the reaction of the system called with 
 an activation of a task*/
static void test_isr1_instance3(void)
{
   
  SCHEDULING_CHECK_STEP(8);
  sendSoftwareIt(0, SOFT_IRQ1);
  
  sendSoftwareIt(0, SOFT_IRQ0); /* As isr1 is runnig, event if we call isr1 before the end of Time Frame,
   the call should be ignored and no Protection Hook should appear.*/
  
  SCHEDULING_CHECK_STEP(9);
  /* Wait isr2 Time Frame elapsed */
		
}
Exemplo n.º 6
0
/*test case:test the reaction of the system called with 
 an activation of a task*/
static void test_callback2_instance(void)
{	
	SCHEDULING_CHECK_STEP(6);
	
	SuspendAllInterrupts();
	SuspendAllInterrupts();
	SuspendAllInterrupts();
	tpl_send_it1();
	ResumeAllInterrupts();
	ResumeAllInterrupts();
	ResumeAllInterrupts();
	
	SCHEDULING_CHECK_STEP(7);
}
Exemplo n.º 7
0
static void test_t2_instance1(void)
{
  Std_ReturnType result_inst_1, result_inst_2, result_inst_3, result_inst_4;

  TestType1 data1 = 0x00;
  TestType2 data2;
  data2.a=0x00;
  data2.b=0x00;


  SCHEDULING_CHECK_INIT(4);
  result_inst_1 = IocSendGroup_ioc1(data1, &data2);
  SCHEDULING_CHECK_AND_EQUAL_INT(4,IOC_E_NOT_OK, result_inst_1);
	
  SCHEDULING_CHECK_INIT(5);
  result_inst_2 = IocReceiveGroup_ioc1(&data1, &data2);
  SCHEDULING_CHECK_AND_EQUAL_INT(5,IOC_E_OK, result_inst_2);	
	
  SCHEDULING_CHECK_INIT(6);
  result_inst_3 = IocSendGroup_ioc2(data1, &data2);
  SCHEDULING_CHECK_AND_EQUAL_INT(6,IOC_E_OK, result_inst_3);
	
  SCHEDULING_CHECK_INIT(7);
  result_inst_4 = IocReceiveGroup_ioc2(&data1, &data2);
  SCHEDULING_CHECK_AND_EQUAL_INT(7,IOC_E_NOT_OK, result_inst_4);

  SCHEDULING_CHECK_STEP(8);

}
Exemplo n.º 8
0
static void test_t2_instance2(void)
{
  Std_ReturnType result_inst_1, result_inst_2, result_inst_3;

  TestType1 data1 = 0x00;
  TestType2 data2;
  data2.a=0x00;
  data2.b=0x00;

  SCHEDULING_CHECK_INIT(9);
  result_inst_1 = IocRead_ioc1(&data1);
  SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(9,IOC_E_OK, result_inst_1);
  SCHEDULING_CHECK_AND_EQUAL_INT(9,0x01, data1);
	
  SCHEDULING_CHECK_INIT(10);
  result_inst_2 = IocRead_ioc2(&data2);
  SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(10,IOC_E_OK, result_inst_2);
  SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(10,0x01, data2.a);
  SCHEDULING_CHECK_AND_EQUAL_INT(10,0x02, data2.b);
	
  SCHEDULING_CHECK_INIT(11);
  result_inst_3 = IocRead_ioc3(&data2);
  SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(11,IOC_E_OK, result_inst_3);
  SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(11,0x0A, data2.a);
  SCHEDULING_CHECK_AND_EQUAL_INT(11,0x0B, data2.b);

  SCHEDULING_CHECK_STEP(12);

  TerminateTask();

}
Exemplo n.º 9
0
static void test_t2_instance1(void)
{
  Std_ReturnType result_inst_1, result_inst_2, result_inst_3;

  TestType1 data1 = 0x00;
  TestType2 data2 = {0x00, 0x00};
	
  SCHEDULING_CHECK_INIT(1);
  result_inst_1 = IocRead_ioc1(&data1);
  SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(1,IOC_E_OK, result_inst_1);
  SCHEDULING_CHECK_AND_EQUAL_INT(1,0xFF, data1);
	
  SCHEDULING_CHECK_INIT(2);
  result_inst_2 = IocRead_ioc2(&data2);
  SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(2,IOC_E_OK, result_inst_2);
  SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(2,0xFF, data2.a);
  SCHEDULING_CHECK_AND_EQUAL_INT(2,0xFF, data2.b);
	
  SCHEDULING_CHECK_INIT(3);
  result_inst_3 = IocRead_ioc3(&data2);
  SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(3,IOC_E_OK, result_inst_3);
  SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(3,0xFA, data2.a);
  SCHEDULING_CHECK_AND_EQUAL_INT(3,0xFA, data2.b);

  SCHEDULING_CHECK_STEP(4);

  TerminateTask();

}
Exemplo n.º 10
0
static void test_t1_instance(void)
{
  Std_ReturnType result_inst_1, result_inst_2, result_inst_3;
  StatusType result_inst_4;

  TestType1 data1 = 0x01;
  TestType2 data2;
  data2.a=0x01;
  data2.b=0x02;
	
  /* test write on simple data type */
  SCHEDULING_CHECK_INIT(5);
  result_inst_1 = IocWrite_ioc1(data1);
  SCHEDULING_CHECK_AND_EQUAL_INT(5,IOC_E_OK, result_inst_1);
	
  /* test write on complex data type */
  SCHEDULING_CHECK_INIT(6);
  result_inst_2 = IocWrite_ioc2(&data2);
  SCHEDULING_CHECK_AND_EQUAL_INT(6,IOC_E_OK, result_inst_2);
	
  /* test write with several senders */
  SCHEDULING_CHECK_INIT(7);
  data2.a=0x0A;
  data2.b=0x0B;
  result_inst_3 = IocWrite_ioc3_sender1(&data2);
  SCHEDULING_CHECK_AND_EQUAL_INT(7,IOC_E_OK, result_inst_3);

  SCHEDULING_CHECK_INIT(8);
  result_inst_4 = ActivateTask(t2);
  SCHEDULING_CHECK_AND_EQUAL_INT(12,E_OK, result_inst_4);


  SCHEDULING_CHECK_STEP(13);

}
Exemplo n.º 11
0
/*test case:test the reaction of the system called with 
 an activation of a task*/
static void test_t2_instance(void)
{	
	SCHEDULING_CHECK_STEP(12);
  
	while(1);  /* --> Protection Hook */
  
}
Exemplo n.º 12
0
/*test case:test the reaction of the system called with 
 an activation of a task*/
static void test_isr2_instance2(void)
{
  SCHEDULING_CHECK_STEP(9);
  
  while(1); /* --> ProtectionHook */
  
}
Exemplo n.º 13
0
static void test_t1_instance(void)
{
  Std_ReturnType  result_inst_1, result_inst_2;
  StatusType result_inst_3, result_inst_4;

  TestType1 data1 = 0x01;
  TestType2 data2;
  data2.a=0x01;
  data2.b=0x02;

  /* test Send */
  SCHEDULING_CHECK_INIT(1);
  result_inst_1 = IocSend_ioc1(data1);
  SCHEDULING_CHECK_AND_EQUAL_INT(1,IOC_E_OK, result_inst_1);

  SCHEDULING_CHECK_INIT(2);
  result_inst_2 = IocWrite_ioc2(&data2);
  SCHEDULING_CHECK_AND_EQUAL_INT(2,IOC_E_OK, result_inst_2);

  SCHEDULING_CHECK_INIT(3);
  result_inst_3 = ActivateTask(t3);
  SCHEDULING_CHECK_AND_EQUAL_INT(6,E_OK, result_inst_3);

  SCHEDULING_CHECK_INIT(7);
  result_inst_4 = ActivateTask(t2);
  SCHEDULING_CHECK_AND_EQUAL_INT(10,E_OK, result_inst_4);

  SCHEDULING_CHECK_STEP(11);

}
Exemplo n.º 14
0
/*test case:test the reaction of the system called with 
an activation of a isr*/
static void test_pretask_instance11(void)
{
	SCHEDULING_CHECK_STEP(13);
	
	tpl_send_it1();
	SuspendAllInterrupts();
	tpl_send_it1();
	ResumeAllInterrupts();
}
Exemplo n.º 15
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_4, result_inst_5, result_inst_6, result_inst_7, result_inst_10, result_inst_11, result_inst_12, result_inst_14;
	TickType result_inst_3, result_inst_13;
	AlarmBaseType result_inst_1;
	
	SCHEDULING_CHECK_INIT(1);
	result_inst_2 = GetAlarmBase(Alarm1, &result_inst_1);
	SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(1,OSMAXALLOWEDVALUE_Counter1, (int)(result_inst_1.maxallowedvalue));
	SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(1,OSTICKSPERBASE_Counter1, (int)(result_inst_1.ticksperbase));
	SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(1,OSMINCYCLE_Counter1, (int)(result_inst_1.mincycle));
	SCHEDULING_CHECK_AND_EQUAL_INT(1,E_OK, result_inst_2);
	
	SCHEDULING_CHECK_INIT(2);
	result_inst_4 = GetAlarm(Alarm1, &result_inst_3);
	SCHEDULING_CHECK_AND_EQUAL_INT(2,E_OS_NOFUNC, result_inst_4);
	
	SCHEDULING_CHECK_INIT(3);
	result_inst_5 = CancelAlarm(Alarm1);
	SCHEDULING_CHECK_AND_EQUAL_INT(3,E_OS_NOFUNC, result_inst_5);
	
	SCHEDULING_CHECK_INIT(4);
	result_inst_6 = SetAbsAlarm(Alarm1, 2, 2);
	SCHEDULING_CHECK_AND_EQUAL_INT(4,E_OK, result_inst_6);
	
	SCHEDULING_CHECK_INIT(5);
	result_inst_7 = SetAbsAlarm(Alarm1, 3, 0);
	SCHEDULING_CHECK_AND_EQUAL_INT(5,E_OS_STATE, result_inst_7);
	
	WaitActivationPeriodicAlarm(Alarm1);
	
	WaitActivationPeriodicAlarm(Alarm1);
	
	SCHEDULING_CHECK_INIT(8);
	result_inst_10 = CancelAlarm(Alarm1);
	SCHEDULING_CHECK_AND_EQUAL_INT(8,E_OK, result_inst_10);
	
	SCHEDULING_CHECK_INIT(9);
	result_inst_11 = SetRelAlarm(Alarm1, 2, 0);
	SCHEDULING_CHECK_AND_EQUAL_INT(9,E_OK, result_inst_11);
	
	SCHEDULING_CHECK_INIT(10);
	result_inst_12 = SetRelAlarm(Alarm1, 3, 0);
	SCHEDULING_CHECK_AND_EQUAL_INT(10,E_OS_STATE, result_inst_12);
	
	SCHEDULING_CHECK_INIT(11);
	result_inst_14 = GetAlarm(Alarm1, &result_inst_13);
	SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(11,2, result_inst_13);
	SCHEDULING_CHECK_AND_EQUAL_INT(11,E_OK, result_inst_14);
	
	WaitActivationOneShotAlarm(Alarm1);
	
	SCHEDULING_CHECK_STEP(13);
	
}
Exemplo n.º 16
0
/*test case:test the reaction of the system called with 
 an activation of a isr*/
static void test_pretask_instance2(void)
{
	
	SCHEDULING_CHECK_STEP(2);
	
	sendSoftwareIt(0, SOFT_IRQ0);
	SuspendAllInterrupts();
	sendSoftwareIt(0, SOFT_IRQ0);
	ResumeAllInterrupts();
}
Exemplo n.º 17
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_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);
	
	
}
Exemplo n.º 18
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, 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);
	
}
Exemplo n.º 19
0
/*test case:test the reaction of the system called with 
 an activation of a isr*/
static void test_error_instance(void)
{
  int err_instance = posttask_instance/2;
  int test_start = err_instance * 4;
	
	SCHEDULING_CHECK_STEP(test_start + 2);
	
	sendSoftwareIt(0, SOFT_IRQ0);
	SuspendAllInterrupts();
	sendSoftwareIt(0, SOFT_IRQ0);
	ResumeAllInterrupts();
}
Exemplo n.º 20
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);
}
Exemplo n.º 21
0
/*test case:test the reaction of the system called with 
 an activation of a task*/
static void test_t3_instance1(void)
{
	StatusType result_inst_1, result_inst_2;
	
	SCHEDULING_CHECK_INIT(3);
	result_inst_1 = WaitEvent(Event3); 
	SCHEDULING_CHECK_AND_EQUAL_INT(7, E_OK, result_inst_1);	
	
	SCHEDULING_CHECK_INIT(8);
	result_inst_2 = WaitEvent(Event2); 
	SCHEDULING_CHECK_AND_EQUAL_INT(50, E_OK, result_inst_2);	
	
	SCHEDULING_CHECK_STEP(51);
	
}
Exemplo n.º 22
0
/*test case:test the reaction of the system called with 
 an activation of a task*/
static void test_isr2_instance(void)
{
	StatusType result_inst_1, result_inst_2;
	
	SCHEDULING_CHECK_INIT(7);
	result_inst_1 = GetResource(Resource1);	
	SCHEDULING_CHECK_AND_EQUAL_INT(7,E_OK, result_inst_1);
	
	SCHEDULING_CHECK_INIT(8);
	result_inst_2 = GetResource(Resource2);	
	SCHEDULING_CHECK_AND_EQUAL_INT(8,E_OK, result_inst_2);
	
	tpl_send_it1();
	
	SCHEDULING_CHECK_STEP(9);
}
Exemplo n.º 23
0
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();


}
Exemplo n.º 24
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;
	
	SCHEDULING_CHECK_INIT(1);
	result_inst_1 = SetAbsAlarm(Alarm1, 2, 0);
	SCHEDULING_CHECK_AND_EQUAL_INT(1,E_OK, result_inst_1);
	
	WaitActivationOneShotAlarm(Alarm1);	
	
	SCHEDULING_CHECK_INIT(5);
	result_inst_2 = SetAbsAlarm(Alarm2, 2, 0);
	SCHEDULING_CHECK_AND_EQUAL_INT(5,E_OK, result_inst_2);
	
	WaitActivationOneShotAlarm(Alarm2);		
	
	SCHEDULING_CHECK_STEP(9);
	
}
Exemplo n.º 25
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;
	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);
	
}
Exemplo n.º 26
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, result_inst_3;
  
  SCHEDULING_CHECK_STEP(1);
  
  /* Wait Time Frame elapsed */
  
  SCHEDULING_CHECK_INIT(2);
	result_inst_1 = SetEvent(t1, t1_event1);
	SCHEDULING_CHECK_AND_EQUAL_INT(2,E_OK, result_inst_1);
  
  SCHEDULING_CHECK_INIT(3);
	result_inst_2 = WaitEvent(t1_event1);
	SCHEDULING_CHECK_AND_EQUAL_INT(3,E_OK, result_inst_2);
  
  SCHEDULING_CHECK_INIT(4);
	result_inst_3 = TerminateTask();
	SCHEDULING_CHECK_AND_EQUAL_INT(4,E_OK, result_inst_3);
  
}
Exemplo n.º 27
0
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);
  result_inst_2 = IocReceiveGroup_ioc1(&data1, &data2);
  SCHEDULING_CHECK_AND_EQUAL_INT(2,IOC_E_NOT_OK, result_inst_2);	

  SCHEDULING_CHECK_INIT(3);
  result_inst_5 = ActivateTask(t2);
  SCHEDULING_CHECK_AND_EQUAL_INT(8,E_OK, result_inst_5);	
	
  SCHEDULING_CHECK_INIT(9);
  result_inst_3 = IocSendGroup_ioc2(data1, &data2);
  SCHEDULING_CHECK_AND_EQUAL_INT(9,IOC_E_NOT_OK, result_inst_3);
	
  SCHEDULING_CHECK_INIT(10);
  result_inst_4 = IocReceiveGroup_ioc2(&data1, &data2);
  SCHEDULING_CHECK_AND_EQUAL_INT(10,IOC_E_OK, result_inst_4);
	


  SCHEDULING_CHECK_STEP(11);

}
Exemplo n.º 28
0
static void test_t3_instance(void)
{
  Std_ReturnType result_inst_1;

  TestType1 data1 = 0xAA;
  TestType2 data2;
  data2.a=0xAA;
  data2.b=0xAA;


  SCHEDULING_CHECK_INIT(4);
  result_inst_1 = IocSend_ioc1(data1);
  SCHEDULING_CHECK_AND_EQUAL_INT(4,IOC_E_NOT_OK, result_inst_1);

  SCHEDULING_CHECK_INIT(5);
  result_inst_1 = IocReceive_ioc1(&data1);
  SCHEDULING_CHECK_AND_EQUAL_INT(5,IOC_E_NOT_OK, result_inst_1);

  SCHEDULING_CHECK_STEP(6);

  TerminateTask();


}
Exemplo n.º 29
0
/*test case:test the reaction of the system called with 
 an activation of a task*/
static void test_t2_instance(void)
{
	SCHEDULING_CHECK_STEP(45);
	
}
Exemplo n.º 30
0
/*test case:test the reaction of the system called with
 an activation of a task*/
static void test_isr2_instance(void)
{
    SCHEDULING_CHECK_STEP(9);
}