Commit 4ca53c06 authored by Antonia Francis's avatar Antonia Francis
Browse files

* Gqueue test finished with full documentation and 100% coverage

parent 4deeb350
...@@ -88,6 +88,20 @@ sent, but the previous one (inferior by 1). assert (reception != ...@@ -88,6 +88,20 @@ sent, but the previous one (inferior by 1). assert (reception !=
sent_level ); assert (reception == sent_level - 1); The other port sent_level ); assert (reception == sent_level - 1); The other port
constitutes a control assay. constitutes a control assay.
Test Sporadic 6 :
These tests are used to verify the behavior when working with IN DATA PORTS
and not IN EVENT DATA PORTS. It allows us to get a coverage of 100% of the code
with this test file.
Initially we verify that the reception has been done well.
First we use a get_value function, and then a next_value before verifying that
a get_count on a IN DATA PORT always gives back the value 1 and an used_size
always giving back the value 0.
Thay behavior awaited is illustrated by Beware Warnings.
We try a get_value on an empty port and finally we dequeue the event
sent from Period Port P2 to Sporad Port P1 to trigger the sporadic task.
## Periodic Test details ## Periodic Test details
Each time messages are sent by the periodic task and received by itself. Each time messages are sent by the periodic task and received by itself.
...@@ -124,8 +138,13 @@ Test Periodic 2 : ...@@ -124,8 +138,13 @@ Test Periodic 2 :
This time two messages are as well sent to the periodic task to itself. This time two messages are as well sent to the periodic task to itself.
The goal is to verify whether, if the queue is full, an error message is well sent. The goal is to verify whether, if the queue is full, only a message is received
We set up a reception port with a size of 1 and we sent 2 messages to this port. and it is the first one.The transport file must send an error message and prevent
the sending of the file.
If a message is printed, then the test is passed. The goal is then to verify whether the store_in function is also blocked
The user is able to see it itself on the console. when the queue of the destined port isfull.
In both cases we verify that the message first sent is not erased by the other ones,
respectively supposedly not transmitted and not stored_in.
If messages are printed, then the test is passed.
In another hand, the goal is to verify that a get_value on an output port
gives right back an error message.
...@@ -17,6 +17,7 @@ public ...@@ -17,6 +17,7 @@ public
P4 : in event data port int { Queue_Size => 42;}; P4 : in event data port int { Queue_Size => 42;};
P5 : out event data port int; P5 : out event data port int;
P6 : in event data port int {Queue_Size => 1;}; P6 : in event data port int {Queue_Size => 1;};
P7 : out data port int; -- XXX
properties properties
Dispatch_Protocol => Periodic; Dispatch_Protocol => Periodic;
Period => 1000 ms; Period => 1000 ms;
...@@ -32,8 +33,7 @@ public ...@@ -32,8 +33,7 @@ public
features features
P1 : in event data port int { Queue_Size => 42;}; P1 : in event data port int { Queue_Size => 42;};
P2 : in event data port int { Queue_Size => 42;}; P2 : in event data port int { Queue_Size => 42;};
P3 : out event data port Int; P3 : in data port int;
P4 : in event data port int { Queue_Size => 42;};
properties properties
Dispatch_Protocol => Sporadic; -- Concurrency configuration Dispatch_Protocol => Sporadic; -- Concurrency configuration
Period => 100 ms; Period => 100 ms;
...@@ -56,9 +56,9 @@ public ...@@ -56,9 +56,9 @@ public
connections connections
C1 : port Per_thread.P2 -> Spo_thread.P1; C1 : port Per_thread.P2 -> Spo_thread.P1;
C2 : port Per_thread.P1 -> Spo_thread.P2; C2 : port Per_thread.P1 -> Spo_thread.P2;
C3 : port Spo_thread.P3 -> Spo_thread.P4; C3 : port Per_thread.P3 -> Per_thread.P4;
C4 : port Per_thread.P3 -> Per_thread.P4; C4 : port Per_thread.P5 -> Per_thread.P6;
C5 : port Per_thread.P5 -> Per_thread.P6; C5 : port Per_thread.P7 -> Spo_thread.P3;
end Torture_Software.impl; end Torture_Software.impl;
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <po_hi_transport.h> #include <po_hi_transport.h>
#include <po_hi_gqueue.h> #include <po_hi_gqueue.h>
#include <po_hi_returns.h>
/*****************************************************************************/ /*****************************************************************************/
/* Helper macros to access AADL entities */ /* Helper macros to access AADL entities */
...@@ -36,36 +37,53 @@ void test_sporad_2(__po_hi_task_id self); ...@@ -36,36 +37,53 @@ void test_sporad_2(__po_hi_task_id self);
void test_sporad_3(__po_hi_task_id self); void test_sporad_3(__po_hi_task_id self);
void test_sporad_4(__po_hi_task_id self); void test_sporad_4(__po_hi_task_id self);
void test_sporad_5(__po_hi_task_id self); void test_sporad_5(__po_hi_task_id self);
void test_sporad_6(__po_hi_task_id self);
bool init = true; bool init = true;
bool first_iteration = true; bool first_iteration = true;
int number = 0; int number = 0;
/*
* Integers allowing to count the events pending on each port
*/
int count_p1; int count_p1;
int count_p2; int count_p2;
int count_p3;
int count_p4; int count_p4;
int count_p5; int count_p5;
int count_p6; int count_p6;
int count_output;
/*
* Declarations of port used in the connections.
*/
__po_hi_local_port_t port_p1 = LOCAL_PORT (spo_thread,p1); __po_hi_local_port_t port_p1 = LOCAL_PORT (spo_thread,p1);
__po_hi_local_port_t port_p2 = LOCAL_PORT (spo_thread,p2); __po_hi_local_port_t port_p2 = LOCAL_PORT (spo_thread,p2);
__po_hi_local_port_t port_p3 = LOCAL_PORT (spo_thread,p3);
__po_hi_local_port_t port_p4 = LOCAL_PORT (per_thread,p4); __po_hi_local_port_t port_p4 = LOCAL_PORT (per_thread,p4);
__po_hi_local_port_t port_p3 = LOCAL_PORT (per_thread,p3);
__po_hi_local_port_t port_p5 = LOCAL_PORT (per_thread,p5);
__po_hi_local_port_t port_p6 = LOCAL_PORT (per_thread,p6); __po_hi_local_port_t port_p6 = LOCAL_PORT (per_thread,p6);
__po_hi_local_port_t port_output = LOCAL_PORT (per_thread, p5);
/* /*
* Semaphore used to coordinate the period and sporad tasks : At the * Semaphore used to coordinate the period and sporad tasks : At the
* end of the first battery of test (number of message == 1), a * end of the first battery of test (number of message == 1), a
* sem_post is done which liberates a sem_wait. The number of * sem_post is done which liberates a sem_wait. The number of
* messages is increased by one. * messages is increased by one for the second test.
*/ */
sem_t *semaphore; sem_t *semaphore;
/*****************************************************************************/ /*********************************************************************************************************************************************/
/*
* Periodic task receiving and sending messages depending on the case.
*/
void period(__po_hi_task_id self) { void period(__po_hi_task_id self) {
int i, j; int i, j;
#if defined (TEST_VERBOSE)
printf("Number of port_p1 = %d, port_p2 = %d, port_p3 = %d, port_p4 = %d, port_p6 = %d, port_output= %d\n", port_p1, port_p2, port_p3, port_p4, port_p6, port_output);
#endif
if (init == true){ if (init == true){
semaphore = sem_open("/aadl", O_CREAT|O_EXCL, S_IRUSR | S_IWUSR, 1); semaphore = sem_open("/aadl", O_CREAT|O_EXCL, S_IRUSR | S_IWUSR, 1);
if (semaphore == NULL) { if (semaphore == NULL) {
...@@ -79,7 +97,12 @@ void period(__po_hi_task_id self) { ...@@ -79,7 +97,12 @@ void period(__po_hi_task_id self) {
*** "number" iterations *** */ *** "number" iterations *** */
if (first_iteration){ if (first_iteration){
sem_wait(semaphore); sem_wait(semaphore);
printf("\n**** Starting Tests **** \n"); if (number < 4){
printf("\n\n**** Starting Tests **** \n");
}
if (number == 4){
printf("\n**** Ending tests **** \n");
}
first_iteration = false; first_iteration = false;
number++; number++;
} }
...@@ -88,8 +111,9 @@ void period(__po_hi_task_id self) { ...@@ -88,8 +111,9 @@ void period(__po_hi_task_id self) {
__po_hi_request_t r2; __po_hi_request_t r2;
/*****************************************************************************/ /*****************************************************************************/
/* *** Initial Test of the different functions *** */ /* *** SENDING FOR TEST SPORADIC 1 to 4 *** */
/* *** Test of gqueue with one message *** */ /* *** Test of gqueue with one message *** */
if (number < 2){ if (number < 2){
/* Message sent on Period Port 1 to Sporad port 2 */ /* Message sent on Period Port 1 to Sporad port 2 */
sent_lvl = lvl; sent_lvl = lvl;
...@@ -98,7 +122,7 @@ void period(__po_hi_task_id self) { ...@@ -98,7 +122,7 @@ void period(__po_hi_task_id self) {
lvl++; lvl++;
#if defined (TEST_VERBOSE) #if defined (TEST_VERBOSE)
printf("\n Storeout P1 to P2, task id = %d, port id = %d", self, LOCAL_PORT (per_thread, p1)); printf("\n Storeout Period P1 to Sporad P2, task id = %d, from port id = %d", self, LOCAL_PORT (per_thread, p1));
#endif #endif
__po_hi_gqueue_store_out __po_hi_gqueue_store_out
...@@ -112,7 +136,7 @@ void period(__po_hi_task_id self) { ...@@ -112,7 +136,7 @@ void period(__po_hi_task_id self) {
r2.PORT_VARIABLE (per_thread,p2) = level; r2.PORT_VARIABLE (per_thread,p2) = level;
level++; level++;
#if defined (TEST_VERBOSE) #if defined (TEST_VERBOSE)
printf("\n Storeout P2 to P1, task id = %d, port id = %d\n", printf("\n Storeout Period P2 to Sporad P1, task id = %d, from port id = %d\n",
self, LOCAL_PORT (per_thread, p2)); self, LOCAL_PORT (per_thread, p2));
#endif #endif
__po_hi_gqueue_store_out __po_hi_gqueue_store_out
...@@ -122,20 +146,22 @@ void period(__po_hi_task_id self) { ...@@ -122,20 +146,22 @@ void period(__po_hi_task_id self) {
} }
/*****************************************************************************/ /*****************************************************************************/
/* *** TEST PERIODIC 1 *** */
/* *** Test of two messages sent on one port *** */ /* *** Test of two messages sent on one port *** */
/* Transmission */ /* Transmission */
count_p4 = __po_hi_gqueue_get_count(self, port_p4); count_p4 = __po_hi_gqueue_get_count(self, port_p4);
if ((number == 2)&&(count_p4 == 0)){ if ((number == 2)&&(count_p4 == 0)){
printf("\n*** TEST PERIODIC 1 ***\n"); printf("\n*** TEST PERIODIC 1 ***\n");
count_p4 = __po_hi_gqueue_get_count(self, port_p4); count_p4 = __po_hi_gqueue_get_count(self, port_p4);
assert (count_p4 == 0); assert (count_p4 == 0);
for (i = 1; i <= number; i++){ for (i = 1; i <= number ; i++){
sent_lvl = lvl; sent_lvl = lvl;
r1.port = REQUEST_PORT (per_thread, p3); r1.port = REQUEST_PORT (per_thread, p3);
r1.PORT_VARIABLE (per_thread,p3) = lvl; r1.PORT_VARIABLE (per_thread,p3) = lvl;
lvl++; lvl++;
#if defined (TEST_VERBOSE) #if defined (TEST_VERBOSE)
printf("\n Storeout P1 to P2, task id = %d, port id = %d", self, LOCAL_PORT (per_thread, p3)); printf("\n Storeout Period P3 to Period P4, task id = %d, from port id = %d", self, LOCAL_PORT (per_thread, p3));
#endif #endif
__po_hi_gqueue_store_out __po_hi_gqueue_store_out
(self, (self,
...@@ -145,9 +171,11 @@ void period(__po_hi_task_id self) { ...@@ -145,9 +171,11 @@ void period(__po_hi_task_id self) {
} }
assert (count_p4 == 0); assert (count_p4 == 0);
} }
/* Reception */ /* Reception */
count_p4 = __po_hi_gqueue_get_count(self, port_p4); count_p4 = __po_hi_gqueue_get_count(self, port_p4);
if ((number == 2)&&(count_p4 == number)){ if ((number == 2)&&(count_p4 == number )){
__po_hi_request_t request; __po_hi_request_t request;
int reception; int reception;
count_p4 = __po_hi_gqueue_get_count(self, port_p4); count_p4 = __po_hi_gqueue_get_count(self, port_p4);
...@@ -158,24 +186,26 @@ void period(__po_hi_task_id self) { ...@@ -158,24 +186,26 @@ void period(__po_hi_task_id self) {
printf("\nfirst request = %d", MACRO_TEST); printf("\nfirst request = %d", MACRO_TEST);
printf("\nsent_lvl = %d", sent_lvl); printf("\nsent_lvl = %d", sent_lvl);
printf("\nreceived = %d", reception); printf("\nreceived = %d", reception);
printf("\nnumber, j = %d %d\n", number, j); printf("\nnumber received, j = %d %d\n", number , j);
#endif #endif
assert(reception == sent_lvl - number + j + 1); assert(reception == sent_lvl - number + j + 1);
__po_hi_gqueue_next_value (self,port_p4); __po_hi_gqueue_next_value (self,port_p4);
} }
printf ("Two Messages test passed\n"); printf ("two Messages test passed\n");
/* Necessary to launch new tests, otherwise triggered by sporadic if it is involved */
first_iteration = true; first_iteration = true;
sem_post(semaphore); sem_post(semaphore);
} }
/*****************************************************************************/ /*****************************************************************************/
/* *** Test of gqueue error message *** */ /* *** TEST PERIODIC 2 *** */
/* *** Test of gqueue error messages *** */
/* *** Test of get value on an output port error message *** */
/* Transmission */ /* Transmission */
count_p6 = __po_hi_gqueue_get_count(self, port_p6); count_p6 = __po_hi_gqueue_get_count(self, port_p6);
if ((number == 3 )&&(count_p6 == 0)){ if ((number == 3)&&(count_p6 == 0)){
printf("\n*** TEST PERIODIC 2 ***\n");
printf("\n\n*** TEST PERIODIC 2 ***\n");
count_p6 = __po_hi_gqueue_get_count(self, port_p6); count_p6 = __po_hi_gqueue_get_count(self, port_p6);
assert (count_p6 == 0); assert (count_p6 == 0);
for (i = 1; i < number ; i++){ for (i = 1; i < number ; i++){
...@@ -184,7 +214,7 @@ void period(__po_hi_task_id self) { ...@@ -184,7 +214,7 @@ void period(__po_hi_task_id self) {
r1.PORT_VARIABLE (per_thread,p5) = lvl; r1.PORT_VARIABLE (per_thread,p5) = lvl;
lvl++; lvl++;
#if defined (TEST_VERBOSE) #if defined (TEST_VERBOSE)
printf("\n Storeout P1 to P2, task id = %d, port id = %d", self, LOCAL_PORT (per_thread, p5)); printf("\n Storeout Period P5 to Period P6, task id = %d, from port id = %d", self, LOCAL_PORT (per_thread, p5));
#endif #endif
__po_hi_gqueue_store_out __po_hi_gqueue_store_out
(self, (self,
...@@ -193,29 +223,110 @@ void period(__po_hi_task_id self) { ...@@ -193,29 +223,110 @@ void period(__po_hi_task_id self) {
__po_hi_send_output (self,REQUEST_PORT(per_thread, p5)); __po_hi_send_output (self,REQUEST_PORT(per_thread, p5));
} }
} }
/* Reception */ /* Reception */
count_p6 = __po_hi_gqueue_get_count(self, port_p6); count_p6 = __po_hi_gqueue_get_count(self, port_p6);
if ((number == 3)&&(count_p6 == 1)){ if (number == 3){
printf ("\n*** An error message should appear *** \n\n");
/* One message only must have been received */
assert (count_p6 == 1);
__po_hi_request_t request;
int reception;
/* Verifying the only message stored is the one send in the first place */
__po_hi_gqueue_get_value(self,port_p6,&(request));
reception = request.PORT_VARIABLE(per_thread,p6);
assert(reception == sent_lvl - 1);
/* The transport send function blocks the sending of the second message to the FULL port.
* An error message should appear */
printf ("\n*** An error message from TRANSPORT should appear *** \n");
/* When forcing the store_in of a random value on a FULL port,
* An error message must be sent by the store_in function */
__po_hi_gqueue_store_in(self, port_p6, &r1);
printf ("*** A second message from GQUEUE should appear *** \n");
/* Verifying the previous store_in has failed and not overwritten the value */
__po_hi_gqueue_get_value(self,port_p6,&(request));
reception = request.PORT_VARIABLE(per_thread,p6);
assert(reception == sent_lvl - 1);
count_p6 = __po_hi_gqueue_get_count(self, port_p6); count_p6 = __po_hi_gqueue_get_count(self, port_p6);
for (j = 0; j < count_p6; j++) { for (j = 0; j < count_p6; j++) {
__po_hi_gqueue_next_value (self,port_p6); __po_hi_gqueue_next_value (self,port_p6);
} }
printf ("\n*** If so, error message test passed *** \n\n"); /* The port is cleaned and at the end of the function, as all ports are flushed, the message will be sent */
printf ("*** If so, 'error message on full queue' test passed *** \n");
/* Trying to reach something on the output port of the case */
int err = __po_hi_gqueue_get_value(self,port_output,&(request));
assert (err == __PO_HI_INVALID);
printf ("*** An error message from GQUEUE should appear *** \n");
printf ("*** If so, 'get value on output port' test passed *** \n");
/* Necessary to launch new tests, otherwise triggered by sporadic if it is involved */
first_iteration = true; first_iteration = true;
sem_post(semaphore); sem_post(semaphore);
} }
if (number > 3){ /*****************************************************************************/
/* *** SENDING FOR TEST SPORADIC 5 *** */
/* *** Test of fifo indata *** */
if (number == 4){
/* Dequeuing the message arrived at the new iteration of the function.
* The message couldn't be sent previously because the port was full (cf test periodic 2).
* The line is only present to reset the port to an empty state */
__po_hi_gqueue_next_value (self,port_p6);
count_p6 = __po_hi_gqueue_get_count(self, port_p6);
assert(count_p6 == 0);
/* Transmission towards the fifo indata port */
sent_lvl = lvl;
r1.port = REQUEST_PORT (per_thread, p7);
r1.PORT_VARIABLE (per_thread,p7) = lvl;
lvl++;
#if defined (TEST_VERBOSE)
printf("\n Storeout Period P7 to Sporad P3, task id = %d, from port id = %d", self, LOCAL_PORT (per_thread, p7));
#endif
__po_hi_gqueue_store_out
(self,
LOCAL_PORT (per_thread, p7),
&r1);
/* Adding a send output through P2 "just" to awaken the sporadic task
to process incoming data on its data port */
#if defined (TEST_VERBOSE)
printf("\n Storeout Period P2 to Sporad P1, task id = %d, from port id = %d", self, LOCAL_PORT (per_thread, p1));
#endif
r1.port = REQUEST_PORT (per_thread, p2);
r1.PORT_VARIABLE (per_thread,p2) = lvl;
__po_hi_gqueue_store_out
(self,
LOCAL_PORT (per_thread, p2),
&r1);
}
/*****************************************************************************/
/* *** Getting out of loop *** */
if (number > 4){
sem_unlink("/aadl"); sem_unlink("/aadl");
sem_close(semaphore); sem_close(semaphore);
exit(0); exit(0);
} }
} }
/*********************************************************************************************************************************************/
/*****************************************************************************/ /*
* Sporadic task triggered by received events.
*/
void sporad(__po_hi_task_id self) { void sporad(__po_hi_task_id self) {
/* Test with one message sent by the Period task */ /* Test with one message sent by the Period task */
if (number == 1){ if (number == 1){
...@@ -231,6 +342,10 @@ void sporad(__po_hi_task_id self) { ...@@ -231,6 +342,10 @@ void sporad(__po_hi_task_id self) {
test_sporad_5 (self); test_sporad_5 (self);
} }
if (number == 4){
test_sporad_6 (self);
}
/* Boolean and semaphore launching the next type of test */ /* Boolean and semaphore launching the next type of test */
first_iteration = true; first_iteration = true;
sem_post(semaphore); sem_post(semaphore);
...@@ -446,3 +561,35 @@ void test_sporad_5(__po_hi_task_id self) { ...@@ -446,3 +561,35 @@ void test_sporad_5(__po_hi_task_id self) {
printf ("FIFO test on port p2 passed\n"); printf ("FIFO test on port p2 passed\n");
} }
/*****************************************************************************/
void test_sporad_6(__po_hi_task_id self) {
__po_hi_request_t request;
int reception;
printf ("\n*** TEST SPORADIC 6 ****\n");
printf ("*** A warning message from GQUEUE (store_in) should have appeared *** \n");
/* Verifying that the reception has been done well */
__po_hi_gqueue_get_value(self,port_p3,&(request));
reception = request.PORT_VARIABLE(spo_thread,p3);
assert(reception == sent_lvl);
/* Asserting the used_size is always of 0 for indata port */
count_p3 = __po_hi_gqueue_used_size(self, port_p3);
assert(count_p3 == 0);
printf ("*** A warning message from GQUEUE (next_value) should appear *** \n");
__po_hi_gqueue_next_value(self,port_p3);
count_p3 = __po_hi_gqueue_used_size(self, port_p3);
assert(count_p3 == 0);
/* Verifying that the get_count is Still of 1 after dequeuing */
printf ("*** A warning message from GQUEUE (get_count) should appear *** \n");
count_p3 = __po_hi_gqueue_get_count(self, port_p3);
assert (count_p3 == 1);
/* Get_value on an empty port */
__po_hi_gqueue_get_value(self,port_p3,&(request));
/* Dequeuing the event that has served to trigger the sporadic task */
int a = __po_hi_gqueue_next_value (self,port_p1);
assert (a == 1);
printf ("\n*** If so, FIFO INDATA test passed *** ");
}
USER_CFLAGS=-g USER_CFLAGS=-g
USER_CFLAGS=-D__PO_HI_USE_GPROF
COVERAGE=gcov
...@@ -268,6 +268,7 @@ void __po_hi_gqueue_init (__po_hi_task_id id, ...@@ -268,6 +268,7 @@ void __po_hi_gqueue_init (__po_hi_task_id id,
assert(__po_hi_gqueues_used_size[id][i] == 0); assert(__po_hi_gqueues_used_size[id][i] == 0);
assert(__po_hi_gqueues_most_recent_values[id][i].port == __PO_HI_GQUEUE_INVALID_PORT); assert(__po_hi_gqueues_most_recent_values[id][i].port == __PO_HI_GQUEUE_INVALID_PORT);
if (i > 0){ if (i > 0){
/* Usually HAS TO be right */
//assert(__po_hi_gqueues_first[id][i] >= 0); //assert(__po_hi_gqueues_first[id][i] >= 0);
} }
} }
...@@ -317,7 +318,6 @@ __po_hi_port_id_t __po_hi_gqueue_store_in (__po_hi_task_id id, ...@@ -317,7 +318,6 @@ __po_hi_port_id_t __po_hi_gqueue_store_in (__po_hi_task_id id,
__DEBUGMSG ("__po_hi_gqueue_store_in : NULL POINTER\n"); __DEBUGMSG ("__po_hi_gqueue_store_in : NULL POINTER\n");
} }
#endif #endif
/* Locking only a mutex */ /* Locking only a mutex */
__PO_HI_DEBUG_DEBUG ("\nWaiting on Store_in on task %d, port = %d, size of port = %d\n", id, port,__po_hi_gqueue_get_port_size(id, port)); __PO_HI_DEBUG_DEBUG ("\nWaiting on Store_in on task %d, port = %d, size of port = %d\n", id, port,__po_hi_gqueue_get_port_size(id, port));
int result = __po_hi_sem_mutex_wait_gqueue(__po_hi_gqueues_semaphores,id); int result = __po_hi_sem_mutex_wait_gqueue(__po_hi_gqueues_semaphores,id);
...@@ -327,6 +327,7 @@ __po_hi_port_id_t __po_hi_gqueue_store_in (__po_hi_task_id id, ...@@ -327,6 +327,7 @@ __po_hi_port_id_t __po_hi_gqueue_store_in (__po_hi_task_id id,
if (__po_hi_gqueue_get_port_size(id,port) == __PO_HI_GQUEUE_FIFO_INDATA) if (__po_hi_gqueue_get_port_size(id,port) == __PO_HI_GQUEUE_FIFO_INDATA)
{ {
memcpy(ptr,request,sizeof(*request)); memcpy(ptr,request,sizeof(*request));
__PO_HI_DEBUG_CRITICAL ("[GQUEUE] BEWARE, for a FIFO_INDATA port, the used_size is always at 0 (not augmented in a store_in) task-id=%d, port=%d\n", id, port);
} }
else else
{ {
...@@ -386,7 +387,6 @@ __po_hi_port_id_t __po_hi_gqueue_store_in (__po_hi_task_id id, ...@@ -386,7 +387,6 @@ __po_hi_port_id_t __po_hi_gqueue_store_in (__po_hi_task_id id,
int rel = __po_hi_sem_release_gqueue(__po_hi_gqueues_semaphores,id); int rel = __po_hi_sem_release_gqueue(__po_hi_gqueues_semaphores,id);
__DEBUGMSG("GQUEUE_SEM_RELEASE %d %d\n", id, rel); __DEBUGMSG("GQUEUE_SEM_RELEASE %d %d\n", id, rel);
assert(rel == __PO_HI_SUCCESS); assert(rel == __PO_HI_SUCCESS);
__DEBUGMSG ("[GQUEUE] store_in completed\n"); __DEBUGMSG ("[GQUEUE] store_in completed\n");
#ifdef __PO_HI_GQUEUE_ASSERTIONS #ifdef __PO_HI_GQUEUE_ASSERTIONS
...@@ -460,6 +460,7 @@ int __po_hi_gqueue_get_count( __po_hi_task_id id, __po_hi_local_port_t port) ...@@ -460,6 +460,7 @@ int __po_hi_gqueue_get_count( __po_hi_task_id id, __po_hi_local_port_t port)
{ {
if (__po_hi_gqueue_get_port_size(id,port) == __PO_HI_GQUEUE_FIFO_INDATA) if (__po_hi_gqueue_get_port_size(id,port) == __PO_HI_GQUEUE_FIFO_INDATA)
{ {